-
Notifications
You must be signed in to change notification settings - Fork 213
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
fix(job): check for errorResult
when polling jobs
#387
Conversation
Codecov Report
@@ Coverage Diff @@
## master #387 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 4 4
Lines 544 544
Branches 75 75
=======================================
Hits 541 541
Misses 2 2
Partials 1 1
Continue to review full report at Codecov.
|
It does seem correct to use status.errorResultsFinal error result of the job. If present, indicates that the job has completed and was unsuccessful. For more information, see troubleshooting errors. status.errors[]The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. Although, I wonder what type of error could happen in |
@stephenplusplus so while investigating #329 I learned that you can set a |
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.
If I'm understanding this correctly, in the past if we received an error and a response we preferred the response? now error takes precedence?
This looks good to me; I'd probably lean towards calling it a breaking change? (wouldn't be shocked if people relied on the old behavior).
}, | ||
}; | ||
|
||
const sandbox = sinon.createSandbox(); | ||
|
||
beforeEach(() => { | ||
job.getMetadata = (callback: Function) => { | ||
callback(null, apiResponse, apiResponse); | ||
callback(null, apiResponse); |
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.
nit: it would be cool if we could get a test case around this change in behavior.
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.
I actually thought this was a behavior change that wasn't pulled over to BigQuery correctly, but now that you said this I think we might have stumbled on to a bug in nodejs-common
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.
Oh, nevermind, my initial guess was right. There was a breaking change in common 0.28.0
and the fix apparently never found its way here.
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.
Change to check for errorResult
instead of any errors
LGTM.
@bcoe somehow I missed your comment, but the response can contain 2 different error fields. |
@tswast so this error started popping up today
Is there something going on with the backend, or should we be preparing a fix for this?? |
This looks like a problem in the back end handling of query parameters, unrelated to this PR. Thanks for the heads up. Investigating. |
Fixes #329
Would like some confirmation from a BQ team member on this one.