Skip to content

Comments

[AIRFLOW-5393] UI crashes in the Ad Hoc Query menu (PULL REQUEST FIX)#6000

Merged
ashb merged 1 commit intoapache:v1-10-stablefrom
drexpp:v1-10-stable
Sep 23, 2019
Merged

[AIRFLOW-5393] UI crashes in the Ad Hoc Query menu (PULL REQUEST FIX)#6000
ashb merged 1 commit intoapache:v1-10-stablefrom
drexpp:v1-10-stable

Conversation

@drexpp
Copy link
Contributor

@drexpp drexpp commented Sep 4, 2019

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

There was a crash in the Airflow Ad Hoc Query menu when you hit the ".csv" button to obtain a csv file of the query if the query is empty. This happened due to a "df variable referenced before assigment", the "df" variable is catched inside a try / except block and "df" is never assigned, instead there is an "error" variable which can be used to detect when the query was empty or the connection could not be stablished.

In the screenshot it fails in line 2295 and the "error" variable will be True.

In line 2317 you can see the proposed change adding "and not error"

alt text

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

    • I didn't know exactly how to unit test this, if you have any advice I will do a test for it. Other than that, I did test checking that the behaviour was as expected:

      • Querying with blank text and unset connection works with an error message
      • Querying with blank text and set connection works with an error message
      • Querying with text and set connection works returning the .csv file
      • Querying with text and unset connection works returning an error message

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":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

Code Quality

  • Passes flake8

@drexpp
Copy link
Contributor Author

drexpp commented Sep 5, 2019

Not sure what is the problem with travis since it exists because of a time out.

@potiuk
Copy link
Member

potiuk commented Sep 5, 2019

I restarted the jobs. We have some stability problems with Kubernetes jobs :(. working on it.

@eladkal
Copy link
Contributor

eladkal commented Sep 5, 2019

shouldn't you should target the PR to v1-10-test branch?

@drexpp
Copy link
Contributor Author

drexpp commented Sep 5, 2019

Yes that's true @eladkal thanks, let's ask @potiuk if the pull should go to v1-10-test branch.

@potiuk
Copy link
Member

potiuk commented Sep 5, 2019

If that error is also present in master - it should go to master and then we can cherry-pick it to v1-10-test for the 1.10.6 release.

@ashb
Copy link
Member

ashb commented Sep 5, 2019

Ad-hoc is only in 1.10.

My general workflow for the v1-10-* branches is that -stable is the target of PRs (as those have tests run by travis, so we know they work before we merge) and reserve v1-10-test for our manual cherry-picking and rebasing.

@drexpp
Copy link
Contributor Author

drexpp commented Sep 5, 2019

@potiuk Well that feature must have been moved/deleted from master since I cannot find any reference to "QueryView" or anything related to v1.10.4 version which had the problem.

I think it must be related to this issue AIRFLOW-1846 # Allow Ad Hoc Query and Charts pages to be disabled via configs

which can be resumen in the following message:

  • Aizhamal Nurmamat kyzy added a comment - 18/May/19 03:13
    • Moving to ui component as part of component refactor. Webapp component will be removed.

So I believe this "bug" is not anymore a problem in the next relases but it stills affect on the deployed version. If you consider the Issue and pull request as "closed", please procceed to close them.

@ashb Oh okay so then I probably did fine doing the pull request to -stable, thanks for taking your time to reply. Anyway, this won't be an issue in +1.10.4 versions so it is fine not to merge it.

Thanks everyone!

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (v1-10-stable@704e48d). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@               Coverage Diff               @@
##             v1-10-stable    #6000   +/-   ##
===============================================
  Coverage                ?   10.73%           
===============================================
  Files                   ?      509           
  Lines                   ?    34256           
  Branches                ?        0           
===============================================
  Hits                    ?     3678           
  Misses                  ?    30578           
  Partials                ?        0
Impacted Files Coverage Δ
airflow/www/views.py 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 704e48d...f91ed51. Read the comment docs.

@drexpp
Copy link
Contributor Author

drexpp commented Sep 23, 2019

Is it okay to close it when changes are merged?

Thanks for the review @ashb.

@ashb ashb merged commit d706735 into apache:v1-10-stable Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants