-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 Pydanitc models introduced for AIP-44 #44552
Conversation
It's not likely this one will be green, but it's likely it will show which parts have to be fixed because they used implicitly Pydantic Models synchronisation. But generally speaking it is ready to take a first pass of review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 12 changed files in this pull request and generated no suggestions.
Files not reviewed (7)
- airflow/serialization/pydantic/init.py: Evaluated as low risk
- airflow/serialization/pydantic/asset.py: Evaluated as low risk
- airflow/serialization/pydantic/dag.py: Evaluated as low risk
- airflow/serialization/pydantic/dag_run.py: Evaluated as low risk
- airflow/serialization/pydantic/job.py: Evaluated as low risk
- airflow/serialization/pydantic/taskinstance.py: Evaluated as low risk
- airflow/serialization/pydantic/tasklog.py: Evaluated as low risk
Comments skipped due to low confidence (1)
airflow/models/taskinstance.py:1
- The function
_get_previous_dagrun_success
is missing thetask_instance
andsession
parameters. It should be defined asdef _get_previous_dagrun_success(task_instance, session) -> DagRun | None:
.
def _get_previous_dagrun_success() -> DagRun | None:
0470905
to
3919b89
Compare
BTW. This is the last one in the #44436 series ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small leftover with DagTag - but otherwise looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
I will not say that I'm glad to see all that gone, but I kind of am :p. Working with DagRun | DagRunPydantic | None
and similars wasn't super easy
happy we're removing |
Yeah ... I had no time to look at the failures today ... but tomorrow 🤞 is the day :). I just feel that there will be some left-overs with the context and some TODOs to fix - it's worth to do it anyway :) |
bcbbb4f
to
a685255
Compare
Speaking of which. I think we have to agree on Pydantic strategy here. There are two reasons why this one is "red"
So far it was really a "future" feature - only working with Airflow 3 and in Airflow 2 it was only working with AIP-44 enabled (which was never a production option, except a few crazy people (cc: @jscheffl ;). So we could possibly even drop it. Or we can likely serialize it using the same mechanism serialization will happen for TaskSDK (@kaxil @ashb)? What would it be? I looked at the datamodels in task_sdk and have not seen context autogenerated yet (did I look in the right place?) maybe it's somewhere else. What plans do you have for for context serialization ?
|
a685255
to
a93e3ad
Compare
We just need to copy into the |
So from those two responses:
Thanks for those answers! Let me try to complete this one then. I will leave the "use_airflow_context" as a feature of Python Virtualenv that only (will) work in Airflow 3 and leave to DO to add context propagation once we have it done for AIP-72. And we should be able to close this one. |
a93e3ad
to
5c8c85c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thanks.
Reopen with full-tests-needed |
39960b3
to
b0dea9b
Compare
The Pudanic models have been used in a number of places still and we are using them also for context passing for PythonVirtualEnv and ExternaPythonOperator - this PR removes all the models and their usages. Closes: apache#44436 # Please enter the commit message for your changes. Lines starting
b0dea9b
to
f520319
Compare
Ok. Looks like Pydantic classes removal is ready to merge - any last pass? I moved the DagTag to fast_api models, and added error messages/conditional tests/ left TODOs to bring If anyone want to have last pass -> feel free. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boom. Let is dissolve :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finally :)
The Pudanic models have been used in a number of places still and we are using them also for context passing for PythonVirtualEnv and ExternaPythonOperator - this PR removes all the models and their usages. Closes: apache#44436 # Please enter the commit message for your changes. Lines starting
The Pudanic models have been used in a number of places still and we are using them also for context passing for PythonVirtualEnv and ExternaPythonOperator - this PR removes all the models and their usages. Closes: apache#44436 # Please enter the commit message for your changes. Lines starting
The Pudanic models have been used in a number of places still and we are using them also for context passing for PythonVirtualEnv and ExternaPythonOperator - this PR removes all the models and their usages.
Closes: #44436
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.