Skip to content

Created new route for results and added redirect for main. #2069

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

Merged
merged 10 commits into from
Apr 2, 2019

Conversation

lbristol88
Copy link
Contributor

@lbristol88 lbristol88 commented Mar 25, 2019

Part of the BigQuery App Engine redesign.

@lbristol88 lbristol88 requested review from engelke and tswast March 25, 2019 21:15
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 25, 2019
Copy link
Contributor

@engelke engelke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to main.py LGTM. Once you update the tests, could you run pytest to ensure they pass and paste the output here?



def test_results(flask_client):
r = flask_client.get('/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test pass? I think by default the test client doesn't follow redirects. You'll need to pass in follow_redirects=True. See: http://flask.pocoo.org/docs/1.0/testing/#logging-in-and-out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this test is now identical to test_main. You should update test_main to check that the redirect goes where expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_main_timeout will also need follow_redirects=True. You should rename that test to test_results_timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the functions as directed and made changes to tests in order for them to pass. Thx!

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Almost ready, just one comment to address.

You'll have to git pull before pushing your update because I clicked the "update to master" button in GitHub.

location = flask.request.args.get("location")

bigquery_client = bigquery.Client(project=project_id, location=location)
query_job = bigquery_client.get_job(job_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_job takes a project and location argument. (See reference). You don't need to create a client in the line above. Instead, pass the project and location here to get_job on the existing (global) bigquery_client.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed line 58 and changed to:
query_job = bigquery_client.get_job(job_id, project=project_id, location=location) as suggested!

@tswast
Copy link
Contributor

tswast commented Apr 2, 2019

@dpebot merge on green

@dpebot
Copy link
Collaborator

dpebot commented Apr 2, 2019

Okay! I'll merge when all statuses are green and all reviewers approve.

@dpebot dpebot added the automerge Merge the pull request once unit tests and other checks pass. label Apr 2, 2019
@dpebot dpebot self-assigned this Apr 2, 2019
@tswast tswast merged commit 8fba904 into master Apr 2, 2019
@tswast tswast deleted the laylab-appengine-bigquery-results branch April 2, 2019 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants