[AIRFLOW-2099] Handle getsource() calls gracefully#3571
[AIRFLOW-2099] Handle getsource() calls gracefully#3571night0wl wants to merge 1 commit intoapache:masterfrom
Conversation
6e3d71f to
09d0a42
Compare
Codecov Report
@@ Coverage Diff @@
## master #3571 +/- ##
===========================================
- Coverage 76.83% 17.89% -58.95%
===========================================
Files 204 204
Lines 15492 15510 +18
===========================================
- Hits 11904 2775 -9129
- Misses 3588 12735 +9147
Continue to review full report at Codecov.
|
|
Could you add some tests that directly call |
|
@ashb no problem, they should go in tests/www/test_utils.py in the UtilsTest TestCase I assume. "One case for each type", this would be 4; one for callable class, one for method, one for partial function, and one for None |
|
Yes to both questions. |
ashb
left a comment
There was a problem hiding this comment.
Remove the print and squash to one commit in this case please :)
tests/www/test_utils.py
Outdated
There was a problem hiding this comment.
Probably shouldn't leave this in here :)
992e7f7 to
e18d1db
Compare
There are several scenarios where Task Instance view tries to render Python callables where 'x' is not the correct artefact to target. This commit adds a helper fuction to test for known scenarios, and derives the source from the correc artefact or as a default returns 'No source available for <type>'. This means that even in unknown or unfixable edge cases, the Task Instance view still renders instead of displaying an exception. AIRFLOW-2099 Add get_python_source unit tests AIRFLOW-2099 Add AttributeError to __call__ except
e18d1db to
331bb51
Compare
|
@ashb any idea what's up with codecov? I rebased again onto master to make sure everything was up-to-date. |
|
Codecov has a bit of a "wobble" and goes up and down in small numbers - I've never dug into why but it doesn't worry me. Oh, that it hasn't run. 🤷 - again not concerning me much. |
There are several scenarios where Task Instance view tries to render Python callables where 'x' is not the correct artefact to target. This commit adds a helper fuction to test for known scenarios, and derives the source from the correc artefact or as a default returns 'No source available for <type>'. This means that even in unknown or unfixable edge cases, the Task Instance view still renders instead of displaying an exception. Closes apache#3571 from night0wl/AIRFLOW-2099_task_view_type_check
There are several scenarios where Task Instance view tries to render Python callables where 'x' is not the correct artefact to target. This commit adds a helper fuction to test for known scenarios, and derives the source from the correc artefact or as a default returns 'No source available for <type>'. This means that even in unknown or unfixable edge cases, the Task Instance view still renders instead of displaying an exception. Closes apache#3571 from night0wl/AIRFLOW-2099_task_view_type_check
There are several scenarios where Task Instance view tries to render
Python callables where 'x' is not the correct artefact to target.
This commit adds a helper fuction to test for known scenarios, and
derives the source from the correct artifact or as a default returns
'No source available for '. This means that even in unknown or
unfixable edge cases, the Task Instance view still renders instead of
displaying an exception.
Make sure you have checked all steps below.
JIRA
Description
Tests
Commits
My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
Passes
git diff upstream/master -u -- "*.py" | flake8 --diff