-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix(scheduler_job_runner/asset): fix how asset dag warning is added #43873
base: main
Are you sure you want to change the base?
Conversation
9bc9afa
to
4bc18b3
Compare
def _get_first_item(x: Sequence[Any]) -> Any: | ||
return x[0] | ||
|
||
warnings_to_have = { |
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.
@uranusjr, I'm not sure whether we want to warn a case like this 🤔 It kinda makes the logic a bit more complicated. The message is just concatenated.
schedule=(
Asset(name="asset1_producer", uri="s3://bucket/asset1_producer1")
| Asset(name="asset1_producer", uri="s3://bucket/asset1_producer2")
| Asset(name="asset1_producer", uri="s3://bucket/asset1_producer3")
| Asset(name="asset1_producer", uri="s3://bucket/asset1_producer4")
),
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.
Do you mean we should reduce the warnings from 3 to 1?
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.
In the existing logic, we only raise the latest one (if I'm not mistaken). In this implementation, the error will look like "Cannot activate asset Asset(...); ... is already associated to ...\nCannot activate asset Asset(...); ... is already associated to ...".
I don't think we can add multiple DagWarning unless we want to remove the unique constriant 🤔
The correct logic is 1. Find the warning that should exist after this round 2. Delete the warnings that no longer needed 3. Update the warnings if already exist and add new warnings if not yet exists
…th_multiple_conflict_asset_in_one_dag
…s multiple conflict asset
4bc18b3
to
8b00864
Compare
Why
The logic for activating assets is not correct now.
What
The correct logic is
Related PR: #43693 (that one fix the logic in the wrong way and is fixed in this PR)
^ 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.