Skip to content

Move lineage mechanism to sdk#48379

Closed
uranusjr wants to merge 1 commit into
apache:mainfrom
astronomer:lineage-in-sdk
Closed

Move lineage mechanism to sdk#48379
uranusjr wants to merge 1 commit into
apache:mainfrom
astronomer:lineage-in-sdk

Conversation

@uranusjr

Copy link
Copy Markdown
Member

The LineageBackend base class is moved to sdk.definitions. Runtime mechanism in airflow.lineage now lives in sdk.execution_time and also called in the task runner.

Lineage hook and collectors are left in Core. You can make a case they can be in the sdk, but it's not necessarily so I'm keeping the work simple for now.

I left a compatibility layer in Core, but will submit a PR later to remove it and rewrite related usages.

A part of #45424. Close #47771.

Comment on lines -74 to -77
.. note:: Behind the scenes Airflow prepares the lineage metadata as part of the ``pre_execute`` method of a task. When the task
has finished execution ``post_execute`` is called and lineage metadata is pushed into XCOM. Thus if you are creating
your own operators that override this method make sure to decorate your method with ``prepare_lineage`` and ``apply_lineage``
respectively.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The hooks are now unconditionally called in the sdk, so the decorators are no longer needed.

@uranusjr
uranusjr marked this pull request as ready for review March 26, 2025 07:53
@uranusjr
uranusjr force-pushed the lineage-in-sdk branch 2 times, most recently from 2653b18 to 8d13d86 Compare March 26, 2025 08:56
The LineageBackend base class is moved to sdk.definitions. Runtime
mechanism in airflow.lineage now lives in sdk.execution_time and also
called in the task runner.

Lineage hook and collectors are left in Core. You can make a case they
can be in the sdk, but it's not necessarily so I'm keeping the work
simple for now.

I left a compatibility layer in Core, but will submit a PR later to
remove it and rewrite related usages.
@uranusjr

uranusjr commented Mar 26, 2025

Copy link
Copy Markdown
Member Author

Going to remove airflow.lineage entirely instead. See #48388.

@uranusjr uranusjr closed this Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Regression]Asset events not getting stored as pipeline_outlets key in xcom

1 participant