fix: AtlanTag propagation defaults now reach the wire (BLDX-1589) β breaking behavior change - #1001
Open
Aryamanz29 wants to merge 1 commit into
Open
fix: AtlanTag propagation defaults now reach the wire (BLDX-1589) β breaking behavior change#1001Aryamanz29 wants to merge 1 commit into
Aryamanz29 wants to merge 1 commit into
Conversation
AtlanTag declared propagate=False (and three sibling flags) but pyatlan serializes requests with exclude_unset=True, so a tag built without those flags sent nothing β and the server default won (propagate=True). The documented default was unenforceable: customers constructing AtlanTag(type_name=t) got propagation they never asked for. Adds AtlanObjectWithDefaults, a base that marks every field with a non-None declared default as set at construction so exclude_unset keeps it; AtlanTag now extends it. None/default_factory fields stay unset and omitted β nothing new leaks onto the wire. Asset models must NOT extend this base (their fields must stay omitted when untouched or partial updates would stomp server values). BREAKING BEHAVIOR CHANGE: callers who construct tags without propagation flags and relied on the server default (propagate) will now get the SDK's documented default (no propagation). Tags parsed from server responses round-trip their real values unchanged (test-covered). Verified live: bare AtlanTag(type_name=t) previously stored propagate=True on the server; with this change the wire carries all four flags and the server stores propagate=False.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AtlanTagdeclarespropagate: Optional[bool] = Field(default=False)β but pyatlan serializes every request withexclude_unset=True(by design: partial updates must not stomp untouched fields). A tag built asAtlanTag(type_name=t)therefore sent nopropagateon the wire, and Atlas applied its own default (CLASSIFICATION_PROPAGATION_DEFAULT = true). The SDK documentedFalse, the server storedTrue.A customer hit this in production: their webhook tags propagated via column lineage and nested-column hierarchy to columns they never tagged. (Zendesk 126980 / BLDX-1589.)
Verified live (wire captured on a test tenant):
AtlanTag(type_name=t)β wire{"typeName": "..."}β server storespropagate=TrueβAtlanTag(type_name=t, propagate=False, ...)β flags on the wire β server preserves them βFix
New base
AtlanObjectWithDefaults: marks every field with a non-None declared default as set at construction, soexclude_unsetserialization keeps it.AtlanTagextends it β a bare construction now sends all four propagation flags with their documented defaults:{"typeName": "...", "propagate": false, "removePropagationsOnEntityDelete": true, "restrictPropagationThroughLineage": false, "restrictPropagationThroughHierarchy": false}Verified live post-fix: server stores
propagate=Falsefor the bare construction. Fields defaulting toNone/default_factorystay unset and omitted β nothing new leaks onto the wire. Asset models must not extend this base (docstring warns): their fields must remain omitted when untouched.Callers who construct tags without propagation flags and relied (knowingly or not) on server-side propagation will stop propagating when they upgrade. This must ship with a prominent Breaking Changes release-note entry (or as v10.0.0 β maintainers' call). Staying on β€9.11.0 keeps current behavior. Migration line: "if you want propagation, set
propagate=Trueexplicitly."Not affected: tags parsed from server responses round-trip their real values (test-covered);
client.asset.add_atlan_tags()already passed flags explicitly.Audit of the same bug class
_call_apiusesexclude_unset=Truefor all requests, so any request model with a non-None declared default is a candidate for the same lie. Sweptpyatlan/model/*: candidates exist inlineage.py,group.py,keycloak_events.py,api_tokens.py,data_mesh.pyβ but each needs per-endpoint live verification (some are masked by required-field validation; some SDK defaults may match server defaults). Deliberately not batch-changed here; the new base makes each future fix a one-line inheritance change once verified. Follow-up ticket to track the audit.atlan-javalikely has the same gap β parity check recommended.Testing
./qa-checks(black/flake8/mypy over 1,000 files) cleanCloses BLDX-1589.
π€ Generated with Claude Code