-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[AIRFLOW-4294] fix missing dag & task runs in UI when . in dag_id #5111
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5111 +/- ##
==========================================
+ Coverage 77.01% 77.28% +0.26%
==========================================
Files 465 465
Lines 29962 29962
==========================================
+ Hits 23076 23156 +80
+ Misses 6886 6806 -80
Continue to review full report at Codecov.
|
Does the old UI not suffer from this? It looks like it should be equally at a fault (though doesn't exist in master anymore). I'm a little bit under the weather: could you explain to me again why the classic UI doesn't suffer from this bug? |
interesting, it does appear that the bug has existed for some time, but I was running 1.10.0 and my dag and task run histories were showing fine. I've been using Airflow since 1.8 I believe, and this is the first time I've seen this issue, but this is my first time looking at any of the web UI code. I encountered this bug because I upgraded to 1.10.3 and all my histories disappeared since I have a |
aha, I see that up until 1.10.2, the payload was indeed keyed on safe_dag_id. as of 1.10.2, it was working in both old and new UIs: looks like it was changed in this commit: I would argue that the coupling of the endpoint response to the way it's used on the client led to this being accidentally changed but I'm not familiar with the API design in Airflow so maybe that's a normal thing. Either way, I would personally prefer a client-side fix because I feel it keeps the endpoint response clean but don't feel too strongly about it so I'll defer to you on which is more consistent with the rest of the web app. |
Client-side fix sounds like the right thing to do, because it then allows other consumers than the Airflow frontend to use this endpoint (at least in theory, in practice the auth might be problematic) |
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway. (cherry picked from commit c696dd4)
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway.
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway. (cherry picked from commit c696dd4)
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway.
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway.
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway.
apache#5111) We used to key on `safe_dag_id` but in that got changed in apache#4368 to use a more efficient query, which broke for non-sub-DAGs that contain a `.` in their id. Arguably this escaping is a front-end concern anyway, so handling the escaping in the front end makes sense anyway.
Make sure you have checked all steps below.
Jira
Description
This fixes a regression when a dag_id has a '.' character in its name. The new UI uses "safe" dag_ids for the IDs of the corresponding DOM elements and when the endpoint
/dag_stats
returns the payload keyed on the regular dag_id, d3 is unable to update the elements.The fix is to convert the dag_ids in the payload to a 'safe' dag_id by replacing all the
.
characters with__dot__
so the relevant DOM elements can be selected and updatedBefore:
After change:
Tests
Manual testing confirms that it show dag runs and task runs correctly
Commits
Documentation
N/A
Code Quality
flake8
N/A