Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cattrs from airflow.lineage #26134

Merged
merged 1 commit into from
Sep 5, 2022
Merged

Conversation

ashb
Copy link
Member

@ashb ashb commented Sep 2, 2022

Cattrs was used for two reasons:

  1. As a hacky way of forcing templated fields on classes
  2. As a way to store the outlets in XCom without needing pickle

1 has been fixed in core for a while now and classes can have
"template_fields" properties (deeply)

2 is now done by using a combo of BaseSerialization and attr.asdict

Part of #26130

Depends on #26142 (for making BaseSerialization.serialize public)

@ashb ashb marked this pull request as draft September 2, 2022 14:23
@ashb ashb changed the title eNo cattrs in lineage Remove cattrs from airflow.lineage Sep 2, 2022
@ashb ashb force-pushed the no-cattrs-in-lineage branch 2 times, most recently from 03f1940 to 75621e7 Compare September 2, 2022 20:25
@kaxil kaxil force-pushed the no-cattrs-in-lineage branch from 75621e7 to 6a15277 Compare September 3, 2022 14:24

# prepare with manual inlets and outlets
op1.pre_execute(ctx1)
op1.post_execute(ctx1)
Copy link
Member

@kaxil kaxil Sep 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud, isn't it in-consistent that non-attr objects are not excluded to be set as "outlets" but excluded for inlets?

Example the following will evaluate to True currently on L149:

assert op1.outlets == [a, file3]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah possibly - I didn't really change this behaviour so I didn't think about it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaxil WDYT? Leave this "as it was" or fix it now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would lean towards leave this "as it was" in this PR and fix it in a separate PR

@ashb ashb force-pushed the no-cattrs-in-lineage branch from 6a15277 to 2a96489 Compare September 5, 2022 11:03
@ashb ashb marked this pull request as ready for review September 5, 2022 11:03
Cattrs was used for two reasons:

1. As a hacky way of forcing templated fields on classes
2. As a way to store the outlets in XCom without needing pickle

1 has been fixed in core for a while now and classes can have
  "template_fields" properties (deeply)

2 is now done by using a combo of BaseSerialization and `attr.asdict`
@ashb ashb force-pushed the no-cattrs-in-lineage branch from 0a3bcc9 to 55c9ee3 Compare September 5, 2022 16:33
@ashb ashb merged commit 25a1a1b into apache:main Sep 5, 2022
@ashb ashb deleted the no-cattrs-in-lineage branch September 5, 2022 17:36
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Sep 13, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.0 milestone Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:lineage area:serialization type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants