Repository navigation
Fix lineage entities sharing mutable defaults across instances - #72509
Merged
mobuchowski merged 1 commit intoSep 9, 2026
Merged
Conversation
Bare mutable defaults on attrs classes are evaluated once and shared class-wide, so tagging one Table (or Column) silently mutated the tags/columns/owners/extra of every other instance — corrupting lineage metadata whenever more than one entity was in play.
Member
|
cc: @kacpermuda @mobuchowski ? Do you think there are no side effects (or rather that we get rid of them) ? |
potiuk
approved these changes
Sep 8, 2026
mobuchowski
approved these changes
Sep 9, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
1 task done
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…e#72509) Bare mutable defaults on attrs classes are evaluated once and shared class-wide, so tagging one Table (or Column) silently mutated the tags/columns/owners/extra of every other instance — corrupting lineage metadata whenever more than one entity was in play.
xvega
pushed a commit
to xvega/airflow
that referenced
this pull request
Sep 13, 2026
…e#72509) Bare mutable defaults on attrs classes are evaluated once and shared class-wide, so tagging one Table (or Column) silently mutated the tags/columns/owners/extra of every other instance — corrupting lineage metadata whenever more than one entity was in play.
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.
The attrs entities in
airflow.providers.common.compat.lineage.entitiesdeclare bare mutable defaults (tags: list[Tag] = [],extra: dict[str, Any] = {}). With@attr.s(auto_attribs=True)such a default is evaluated once and shared class-wide, so mutating one instance silently mutates every other instance:This affects
Table.tags/columns/owners/extraandColumn.tags, i.e. lineage metadata can leak between unrelated entities whenever more than one is constructed. Found while writing the missing test module for this file (#72506).The fix switches the five defaults to
attr.Factory(list)/attr.Factory(dict). Regression tests assert per-instance isolation and fail on the previous code.Note: #72506 (in flight) adds broader coverage for the same module in the same test file; whichever lands second will be rebased.
related: #35442
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines