Skip to content
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(types): move JobLoadMetadata writeDisposition #365

Merged
merged 1 commit into from
Mar 1, 2019
Merged

fix(types): move JobLoadMetadata writeDisposition #365

merged 1 commit into from
Mar 1, 2019

Conversation

arjenvanderende
Copy link
Contributor

@arjenvanderende arjenvanderende commented Mar 1, 2019

The writeDisposition field for interface JobLoadMetadata appears to have been defined incorrectly; it does not belong under timePartitioning.

Typescript fails to compile if I define it under the root, but works as expected if I cast the options to any like so:

new BigQuery({ projectId: "my-project-id" })
    .dataset("my_dataset")
    .table("my_table")
    .load("my_file.csv", {
        format: "csv",
        writeDisposition: "WRITE_TRUNCATE",
    } as any);

See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 1, 2019
Copy link
Contributor

@stephenplusplus stephenplusplus left a comment

Choose a reason for hiding this comment

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

Thank you!

src/table.ts Outdated
};
writeDisposition?: 'WRITE_TRUNCATE'|'WRITE_APPEND'|'WRITE_EMPTY';
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this. Would you mind taking out the specific string values, however? The upstream is the official resource for acceptable values, and we don't want to duplicate from this layer in the event it is changed upstream.

Copy link
Contributor Author

@arjenvanderende arjenvanderende Mar 1, 2019

Choose a reason for hiding this comment

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

No problem. I think it improves typing, but I understand your reasoning for wanting to keep it simple.

Keep in mind, I copied the definitions from CopyTableMetadata which also includes specific string values. 😉
See: https://github.com/googleapis/nodejs-bigquery/blob/master/src/table.ts#L151-L157

I changed the type back to an optional string and amended/rebased the commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, gotcha. I didn't realize it was there, too! Thank you for all of the help!

@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 1, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 1, 2019
@codecov
Copy link

codecov bot commented Mar 1, 2019

Codecov Report

Merging #365 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #365   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files           4        4           
  Lines         544      544           
  Branches       75       75           
=======================================
  Hits          541      541           
  Misses          2        2           
  Partials        1        1
Impacted Files Coverage Δ
src/table.ts 100% <ø> (ø) ⬆️

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 444ef11...94e9fd3. Read the comment docs.

@JustinBeckwith JustinBeckwith merged commit 647eda0 into googleapis:master Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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