-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Conversation
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.
LGTM
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.
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('/') |
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.
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
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.
Also, this test is now identical to test_main
. You should update test_main
to check that the redirect goes where expected.
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.
test_main_timeout
will also need follow_redirects=True
. You should rename that test to test_results_timeout
.
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.
Renamed the functions as directed and made changes to tests in order for them to pass. Thx!
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.
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) |
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.
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
.
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.
Removed line 58 and changed to:
query_job = bigquery_client.get_job(job_id, project=project_id, location=location)
as suggested!
@dpebot merge on green |
Okay! I'll merge when all statuses are green and all reviewers approve. |
Part of the BigQuery App Engine redesign.