Skip to content

Update sdk lazy imports for lineage#64123

Merged
gopidesupavan merged 2 commits intoapache:mainfrom
gopidesupavan:fix-lineag-import-error
Mar 24, 2026
Merged

Update sdk lazy imports for lineage#64123
gopidesupavan merged 2 commits intoapache:mainfrom
gopidesupavan:fix-lineag-import-error

Conversation

@gopidesupavan
Copy link
Copy Markdown
Member

Part of this https://github.com/apache/airflow/pull/61157/changes

Without this it causes attribute error:

>>> import airflow.lineage as lineage
>>> print(lineage.hook)
2026-03-23T21:56:15.474793Z [warning  ] The `airflow.lineage.hook` attribute is deprecated. Please use `'airflow.sdk.lineage'`. [py.warnings] category=DeprecatedImportWarning filename=<stdin> lineno=1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/airflow/airflow-core/src/airflow/utils/deprecation_tools.py", line 84, in getattr_with_deprecation
    return getattr(importlib.import_module(new_module), new_class_name)
  File "/opt/airflow/task-sdk/src/airflow/sdk/__init__.py", line 247, in __getattr__
    val = getattr(mod, name)
AttributeError: module 'airflow.sdk.lineage' has no attribute 'lineage'

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    codex

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@gopidesupavan gopidesupavan merged commit e967fb5 into apache:main Mar 24, 2026
112 checks passed
@gopidesupavan gopidesupavan deleted the fix-lineag-import-error branch March 24, 2026 06:30
vatsrahul1001 pushed a commit that referenced this pull request Mar 25, 2026
* Update sdk lazy imports for lineage

* Update docs
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.

3 participants