-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix Graph View for DAGs with mapped operators #54756
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 Graph View for DAGs with mapped operators #54756
Conversation
jscheffl
left a comment
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.
Can you also add a pytest to prevent regression of this error?
|
Yes for sure, I'll add a unit test early tomorrow |
|
cc: @kaxil -> I think that one would be great to get in 3.0.6 |
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, yes a regression test would be nice. Don't know how and when this got broken. Most probably #53696
Verified, v3-0-test branch is not affect, must be a change targeted for 3.1.0 that broke it. But we can still preventive cherry pick. |
854de19 to
db3a478
Compare
jscheffl
left a comment
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.
Thanks for the pytest!
|
This should close #54665 too. Thanks. |
o-nikolas
left a comment
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, love it when there are more lines of test code added then src code 😁
This reverts commit e790409.
…organize tests Follow-up of the fix in apache#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
…organize tests Follow-up of the fix in apache#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
…organize tests Follow-up of the fix in apache#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
…organize tests (#54857) Follow-up of the fix in #54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
* Add unit tests to prevent regression
…organize tests (apache#54857) Follow-up of the fix in apache#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
…organize tests (apache#54857) Follow-up of the fix in apache#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing
…organize tests (#54857) Follow-up of the fix in apache/airflow#54756 - Move `task_group_to_dict` and `task_group_to_dict_grid` functions from `task-sdk` to `airflow-core` API services - Update import paths in `grid.py` and `structure.py` to use new server-side location - Update deprecation mappings to point to new FastAPI service module locations - Remove `AbstractOperator` from isinstance checks in server-side functions (now handles only serialized objects) - Split mixed tests: moved TaskGroup functionality tests to `task-sdk`, keep server function tests in `airflow-core` - Add comprehensive TaskGroup tests in `task-sdk` covering creation, relationships, decorators, and validation - Create clear architectural boundary: client-side TaskGroup authoring vs server-side serialized DAG processing GitOrigin-RevId: c8a0f51f89dc5c75b86c6888154073c08c2a0671
closes: #54753
closes #54665
Problem Description
The Airflow UI Graph View fails to display DAGs containing dynamically mapped operators (created with
.expand()). When users try to view such DAGs in the Graph View, the page fails to load and shows a 500 Internal Server Error due to cascading errors in the UI rendering pipeline.Errors Observed
First Error:
Subsequent Error (after fixing the first):
Both errors occur because
MappedOperatorinstances are incorrectly treated asTaskGroupobjects throughout the UI rendering pipeline, causing the system to call TaskGroup-specific methods that don't exist onMappedOperator.Proposed Solution
Updated both functions to properly recognize
MappedOperatoras a task-like object rather than a TaskGroup. These changes ensureMappedOperatorinstances are handled consistently as tasks throughout the entire UI rendering pipeline, preventing both the initial error and subsequent cascading failures.Testing
task.expand()operations^ 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 airflow-core/newsfragments.