Skip to content

Refactor imports from 'airflow-core' out of 'shared/stats'#62127

Open
xBis7 wants to merge 5 commits intoapache:mainfrom
xBis7:refactor-core-imports-in-stats
Open

Refactor imports from 'airflow-core' out of 'shared/stats'#62127
xBis7 wants to merge 5 commits intoapache:mainfrom
xBis7:refactor-core-imports-in-stats

Conversation

@xBis7
Copy link
Contributor

@xBis7 xBis7 commented Feb 18, 2026

This patch refactors the Stats.initialize() method so that it won't import any packages from airflow-core.

Instead of that method making calculations and then initializing the correct factory object, it will accept the factory as a parameter.

The initialization logic will be moved under a utils file in airflow-core and a duplicate file in task-sdk. This is the best approach forward based on offline discussions.


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

  • 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 or {issue_number}.significant.rst, in airflow-core/newsfragments.

@xBis7
Copy link
Contributor Author

xBis7 commented Feb 18, 2026

@amoghrajesh @potiuk Can you take a look?

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

General direction looks good, thanks @xBis7!

Some comments and we are good.

@xBis7 xBis7 force-pushed the refactor-core-imports-in-stats branch from f0c05d6 to 99c1e3b Compare February 19, 2026 13:55
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

LGTM +1

@potiuk WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processing area:Executors-core LocalExecutor & SequentialExecutor area:Scheduler including HA (high availability) scheduler area:task-sdk area:Triggerer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments