Replace external_trigger check with DagRunType#45961
Merged
Lee-W merged 5 commits intoapache:mainfrom Feb 25, 2025
Merged
Conversation
45cf835 to
9eef4f1
Compare
external_trigger check with DagRunTypeexternal_trigger check with DagRunType
ashb
reviewed
Jan 24, 2025
Member
ashb
left a comment
There was a problem hiding this comment.
This also needs a newsfragment noting about the removal of it please
airflow/migrations/versions/0056_3_0_0_remove_external_trigger_field.py
Outdated
Show resolved
Hide resolved
airflow/migrations/versions/0056_3_0_0_remove_external_trigger_field.py
Outdated
Show resolved
Hide resolved
airflow/migrations/versions/0056_3_0_0_remove_external_trigger_field.py
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/standard/operators/latest_only.py
Outdated
Show resolved
Hide resolved
2fee34c to
a385e61
Compare
uranusjr
reviewed
Feb 19, 2025
uranusjr
reviewed
Feb 20, 2025
providers/standard/src/airflow/providers/standard/operators/latest_only.py
Outdated
Show resolved
Hide resolved
uranusjr
reviewed
Feb 20, 2025
uranusjr
reviewed
Feb 20, 2025
providers/openlineage/tests/unit/openlineage/plugins/test_adapter.py
Outdated
Show resolved
Hide resolved
d69f748 to
3d7605b
Compare
3d7605b to
5ff5563
Compare
Member
Author
|
Only non-related |
5ff5563 to
cbe167a
Compare
Member
|
Not unrelated, those lines reference the removed |
Member
|
I added a commit that should fix the static checks. |
uranusjr
approved these changes
Feb 25, 2025
Lee-W
reviewed
Feb 25, 2025
- Fix test_handle_multiple_columns_unique_constraint_error - Resolve ashb code review - Add newsfragment - Replace external_trigger is False logic with run_type is SCHEDULED - Fix _emit_true_scheduling_delay_stats_for_finished_state - Fix migrations fix after rebasing to latest main Fix test_exceptions and static check after rebasing Fix test_dag_run and erd static check
The 'triggered_by' field used to only be shown when the run is externally triggered. Rather than using run_type to maintain the conditional, I decided to render the field unconditionally instead, since the value could be useful for scheduler-created runs too (for example, distinguishing whether a run is asset-triggered or time-scheduled).
Lee-W
reviewed
Feb 25, 2025
fcf4e97 to
aba5eec
Compare
Lee-W
approved these changes
Feb 25, 2025
ashb
reviewed
Feb 25, 2025
ashb
reviewed
Feb 25, 2025
Member
ashb
left a comment
There was a problem hiding this comment.
LGTM, one small change needed in task_sdk as a result though please.
ambika-garg
pushed a commit
to ambika-garg/airflow
that referenced
this pull request
Feb 28, 2025
* Replace external_trigger check with DagRunType - Fix test_handle_multiple_columns_unique_constraint_error - Resolve ashb code review - Add newsfragment - Replace external_trigger is False logic with run_type is SCHEDULED - Fix _emit_true_scheduling_delay_stats_for_finished_state - Fix migrations fix after rebasing to latest main Fix test_exceptions and static check after rebasing Fix test_dag_run and erd static check * fixup! Fix run_type logic, remove unused externally_triggered_type * fixup! Restore external_trigger value when downgrade * Remove externally_trigger reference in frontend The 'triggered_by' field used to only be shown when the run is externally triggered. Rather than using run_type to maintain the conditional, I decided to render the field unconditionally instead, since the value could be useful for scheduler-created runs too (for example, distinguishing whether a run is asset-triggered or time-scheduled). * docs(newsfragments): add migration rules --------- Co-authored-by: Tzu-ping Chung <[email protected]> Co-authored-by: Wei Lee <[email protected]>
nailo2c
pushed a commit
to nailo2c/airflow
that referenced
this pull request
Apr 4, 2025
* Replace external_trigger check with DagRunType - Fix test_handle_multiple_columns_unique_constraint_error - Resolve ashb code review - Add newsfragment - Replace external_trigger is False logic with run_type is SCHEDULED - Fix _emit_true_scheduling_delay_stats_for_finished_state - Fix migrations fix after rebasing to latest main Fix test_exceptions and static check after rebasing Fix test_dag_run and erd static check * fixup! Fix run_type logic, remove unused externally_triggered_type * fixup! Restore external_trigger value when downgrade * Remove externally_trigger reference in frontend The 'triggered_by' field used to only be shown when the run is externally triggered. Rather than using run_type to maintain the conditional, I decided to render the field unconditionally instead, since the value could be useful for scheduler-created runs too (for example, distinguishing whether a run is asset-triggered or time-scheduled). * docs(newsfragments): add migration rules --------- Co-authored-by: Tzu-ping Chung <[email protected]> Co-authored-by: Wei Lee <[email protected]>
ntBre
pushed a commit
to astral-sh/ruff
that referenced
this pull request
Feb 9, 2026
…context key for Airflow 3.0 (`AIR301`) (#22850) ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Context: apache/airflow#41641 1. apache/airflow#45961 * <strike>create_dagrun removed from airflow...DAG</strike> (This has already been implemented in AIR301) * context key dag_run.external_trigger removed 2. apache/airflow#45960 * context["inlet_events"]["url"] → context["inlet_events"][Asset("url")] 3. apache/airflow#41348 * context key triggering_dataset_events → triggering_asset_events The existing AIR301 rules can detect when users access a removed key such as `execution_date` through Airflow's `context`. For example, `context["execution_date"]`, or `context["dag_run"]`. However, if an attribute is deprecated from a context key, such as `context["dag_run"].external_trigger`, the current implement will not flag it. This PR adds the logic for such check, and add two rules to flag the deprecated attribute for the `"dag_run"` and `"inlet_events"` context key. In addition to this, `"triggering_dataset_events"` is a deprecated context key which can be handled by the existing rule. However, the existing rule doesn't raise a diagnostic. Hence, the rule logic is refactored a little bit, such that we can add this check and suggest a `Replacement::Rename`. ## Test Plan <!-- How was it tested? --> The test cases have been added to `AIR301_context.py`, and all the tests have been run locally and success. @Lee-W , could you please review it when you have time, thanks! ## Notes In #22376, we introduced some improvements to the AIR301 code. I will re-base this PR when we are all good on that, so it can pick up those code structure improvements, and updated rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #45932
^ 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.rstor{issue_number}.significant.rst, in newsfragments.