Visitar URL original
Renaming variables to be consistent with code logic by khalidmammadov · Pull Request #18685 · apache/airflow · GitHub
Skip to content

Renaming variables to be consistent with code logic - #18685

Merged
potiuk merged 1 commit into
apache:mainfrom
khalidmammadov:rename_trigger_dagrun_names
Oct 5, 2021
Merged

potiuk merged 1 commit into
apache:mainfrom
khalidmammadov:rename_trigger_dagrun_names

Conversation

@khalidmammadov

Copy link
Copy Markdown
Contributor

This is a simple change to rename variables to be consistent with code logic and with the "story-line"

So, basically code calls create_dagrun() to create a dag run... and assigns it to a variable called "trigger". Although it's "ok" to name that way, it's much more readable to make it clear/explicit and call returned object a "dagrun" as it's an instance of it.
Also reading it in English trigger conveys a bit different meaning i.e. original purpose of the action airflow dags trigger ... and so not best name for the returned object and subsequent collection of objects i.e. triggers[]


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Oct 2, 2021
@uranusjr uranusjr closed this Oct 3, 2021
@uranusjr uranusjr reopened this Oct 3, 2021

@0ex-d 0ex-d left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clean

@potiuk potiuk closed this Oct 3, 2021
@potiuk potiuk reopened this Oct 3, 2021
@potiuk

potiuk commented Oct 3, 2021 •

Copy link
Copy Markdown
Member

We do not really want to "improve" experimental API. It is deprecated and we are removing it in Airflow 3. I think changing the code to make it cleaner has no value, and it brings risk, also it "muddies" the history for it. There is no real need to make it consistent.

@potiuk potiuk closed this Oct 3, 2021
@uranusjr

uranusjr commented Oct 4, 2021

Copy link
Copy Markdown
Member

@potiuk This function is used by more than the experiemental API though. Currently both TriggerDagRunOperator and the local API client depends on it (there may be more, I'm not sure).

@uranusjr uranusjr added area:core and removed area:API Airflow's REST/HTTP API labels Oct 4, 2021
@uranusjr

uranusjr commented Oct 4, 2021

Copy link
Copy Markdown
Member

Changing the label to core since this function is not technically only related to the API. Even if we remove the exsperiemental API, we still need to either copy or re-implement this function somewhere else, and we will face the exact same issue when we do that.

@uranusjr uranusjr reopened this Oct 4, 2021
@potiuk

potiuk commented Oct 4, 2021 •

Copy link
Copy Markdown
Member

@potiuk This function is used by more than the experiemental API though. Currently both TriggerDagRunOperator and the local API client depends on it (there may be more, I'm not sure).

So I think we should move it out from "experimental" - maybe in the same PR - this will make it easier to remove experimental API in 3.0 and make it part of the "Airflow API" ? How about moving it to airflow.utils.trigger_dag.py ?

@uranusjr

uranusjr commented Oct 4, 2021

Copy link
Copy Markdown
Member

+1 to moving it out (IIRC there are a few more others in the similar situation), but airflow.utils feels wrong to me. The function depends on things in airflow.models which depends on many things in airflow.utils, and this circular relationship may produce issues down the road. Something like airflow.operations or even airflow.trigger_dags would be better.

@potiuk

potiuk commented Oct 4, 2021 •

Copy link
Copy Markdown
Member

Something like airflow.operations or even airflow.trigger_dags would be better.

+1 for trigger_dags - I also do not like general "utils" :)

@khalidmammadov

Copy link
Copy Markdown
Contributor Author

+1 airflow.operations

What about this PR then? :) Is there any issue with it? If not shall we merge and then move different PR?

@uranusjr

uranusjr commented Oct 4, 2021

Copy link
Copy Markdown
Member

I think we can merge this as-is and then do the moving separately

@potiuk
potiuk merged commit 6b71eac into apache:main Oct 5, 2021
@github-actions

github-actions Bot commented Oct 5, 2021

Copy link
Copy Markdown
Contributor

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions Bot added the okay to merge It's ok to merge this PR as it does not require more tests label Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core okay to merge It's ok to merge this PR as it does not require more tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants