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

[airflow] Avoid deprecated values (AIR302) #14582

Merged
merged 5 commits into from
Dec 2, 2024

Conversation

uranusjr
Copy link
Contributor

@uranusjr uranusjr commented Nov 25, 2024

Summary

Airflow 3.0 removes various deprecated functions, members, modules, and other values. They have been deprecated in 2.x, but the removal causes incompatibilities that we want to detect.

(We are deprecating a lot more things. I want to use this to establish a basic structure so future checks can be submitted more easily.)

Ref: #14626

Test Plan

A test fixture is included in the PR.

@uranusjr uranusjr force-pushed the airflow-member-removals branch 2 times, most recently from 111ee16 to b3642c3 Compare November 25, 2024 08:56
Copy link
Contributor

github-actions bot commented Nov 25, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -1 violations, +0 -0 fixes in 1 projects; 54 projects unchanged)

apache/airflow (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- performance/src/performance_dags/performance_dag/performance_dag.py:230:11: AIR301 DAG should have an explicit `schedule` argument
+ performance/src/performance_dags/performance_dag/performance_dag.py:244:9: AIR302 `schedule_interval` is removed in Airflow 3.0; use schedule instead

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
AIR302 1 1 0 0 0
AIR301 1 0 1 0 0

@MichaReiser MichaReiser added rule Implementing or modifying a lint rule preview Related to preview mode features labels Nov 25, 2024
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

This is great. Thank you. I've two small questions/suggestions.

crates/ruff_linter/src/codes.rs Outdated Show resolved Hide resolved
@MichaReiser
Copy link
Member

Feel free to ping me when you rebased the PR and I'll merge it. This is great work.

@uranusjr uranusjr force-pushed the airflow-member-removals branch 2 times, most recently from 4843c41 to 1f5ec14 Compare November 27, 2024 10:14
@uranusjr
Copy link
Contributor Author

Alright, I’ve added argument deprecation to AIR302. I also added some structure in the module since we’re probably going to add other kinds of deprecation (like foo["deprecated"]).

@uranusjr uranusjr requested a review from MichaReiser November 28, 2024 13:28
@uranusjr uranusjr force-pushed the airflow-member-removals branch from 87f000b to 352feb4 Compare November 28, 2024 13:31
@Lee-W Lee-W mentioned this pull request Nov 29, 2024
2 tasks
@uranusjr uranusjr force-pushed the airflow-member-removals branch from 6baabb0 to b9fe68c Compare December 2, 2024 06:36
Airflow 3.0 removes various deprecated functions, members, modules, and
other values. They have been deprecated in 2.x, but the removal causes
incompatibilities that we want to detect.
When a deprecated schedule argument is found on a DAG, it is more
appropriate to emit an AIR302 to signify a rename, instead of telling
the user to add a 'schedule' argument (which won't work unless they also
remove the deprecated argument).
@MichaReiser MichaReiser force-pushed the airflow-member-removals branch from b9fe68c to 3f381e6 Compare December 2, 2024 07:34
@MichaReiser MichaReiser enabled auto-merge (squash) December 2, 2024 07:35
@MichaReiser MichaReiser merged commit 76d2e56 into astral-sh:main Dec 2, 2024
20 checks passed
@uranusjr uranusjr deleted the airflow-member-removals branch December 2, 2024 09:14
dhruvmanila added a commit that referenced this pull request Dec 10, 2024
…#14887)

## Summary

Add replacement fixes to deprecated arguments of a DAG.

Ref #14582 #14626

## Test Plan

Diff was verified and snapshots were updated.

---------

Co-authored-by: Dhruv Manilawala <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants