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

Do not dynamically determine op links for emr serverless start job operator #40627

Merged

Conversation

o-nikolas
Copy link
Contributor

@o-nikolas o-nikolas commented Jul 5, 2024

The dynamic determination of which extra link to include for the EmrServerlessStartJobOperator does not work with templated fields, since that evaluation was happening at DAG parsing time. This dynamic determination has been completely removed because:

  1. If using templated fields for some inputs it needed, DAG parsing
    would fail.
  2. Changing the DAG definition relating to those links, would often
    remove links for all previous DAG runs.
  3. It overly complicates the code.

The new behaviour is to add all links to the TI and only those that are enabled will be "persisted" (i.e. actually have a link) and those that are not will be present but greyed out and will link back to the TI (the Airflow default).

Screenshot from 2024-07-05 10-50-23

fixes #40103


^ 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.

The dynamic determination of which extra link to include for the
EmrServerlessStartJobOperator does not work with templated fields, since
that evaluation was happening at DAG parsing time. This dynamic
determination has been completely removed because:

1) If using templated fields for some inputs it needed, DAG parsing
   would fail.
2) Changing the DAG definition relating to those links, would often
   remove links for all previous DAG runs.
3) It overly complicates the code.

The new behaviour is to add all links to the TI and only those that are enabled
will be "persisted" (i.e. actually have a link) and those that are not will be
present but greyed out and will link back to the TI (the Airflow default).
@o-nikolas
Copy link
Contributor Author

CC @dacort

@dacort
Copy link
Contributor

dacort commented Jul 6, 2024

Big fan of removing the complicated code, never really liked it. The main reason I did the dynamic stuff is because the list of buttons got really long at one point, but it doesn't look as bad as I remember in the screenshot. 😁

I did take a quick peak to make sure it will still function as intended and looks like the operator itself has duplicate logic to toggle/persist the links, so it should work fine!

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

+1 for this change

@eladkal eladkal merged commit c72920a into apache:main Jul 6, 2024
51 checks passed
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
The dynamic determination of which extra link to include for the
EmrServerlessStartJobOperator does not work with templated fields, since
that evaluation was happening at DAG parsing time. This dynamic
determination has been completely removed because:

1) If using templated fields for some inputs it needed, DAG parsing
   would fail.
2) Changing the DAG definition relating to those links, would often
   remove links for all previous DAG runs.
3) It overly complicates the code.

The new behaviour is to add all links to the TI and only those that are enabled
will be "persisted" (i.e. actually have a link) and those that are not will be
present but greyed out and will link back to the TI (the Airflow default).
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.

EmrServerlessStartJobOperator causes dag load failure when using XComArg
5 participants