Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: error using empty array of structs parameter#474

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tswast merged 15 commits intogoogleapis:masterfromplamut:iss-463
Feb 24, 2021

Conversation

@plamut
Copy link
Contributor

@plamutplamut commentedJan 19, 2021
edited
Loading

Fixes#463.

This PR adds an optional type info parameter toArrayQueryParameter so that array query parameters with STRUCT items can be used in queries even if they are empty. This is a solution similar tothe one used in e.g. the Ruby client.

(for non-struct items the type can always be determined by using thearray_type argument)

PR checklist:

  • Make sure to open an issue as abug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@plamutplamut requested review froma team andstephaniewang526 and removed request fora teamJanuary 19, 2021 12:43
@product-auto-labelproduct-auto-labelbot added the api: bigqueryIssues related to the googleapis/python-bigquery API. labelJan 19, 2021
@google-clagoogle-clabot added the cla: yesThis human has signed the Contributor License Agreement. labelJan 19, 2021
@plamutplamut added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJan 19, 2021
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJan 19, 2021
@plamutplamut requested a review fromtswastFebruary 4, 2021 12:03
raiseNotImplementedError


classScalarQueryParameterType(_AbstractQueryParameterType):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should do this in this PR, but I'm tempted to ask for an additional set of constants ingoogle.cloud.bigquery.enums that has all the scalar types defined as objects (without name & description). I imagine that will be useful when we eventually create an "array of structs query parameter" code sample.

Copy link
ContributorAuthor

@plamutplamutFeb 20, 2021
edited
Loading

Choose a reason for hiding this comment

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

Sounds reasonable, let's do it in a follow-up PR. 👍

Edit: It's actually very straightforward (if I understood it correctly, that is), thus added that in an extra commit.

@plamutplamut requested a review fromtswastFebruary 20, 2021 12:15
DATETIME="DATETIME"


classSqlParameterScalarTypes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Beautiful!

plamut reacted with hooray emoji
@tswasttswast merged commitc1d15f4 intogoogleapis:masterFeb 24, 2021
gcf-merge-on-greenbot pushed a commit that referenced this pull requestFeb 25, 2021
🤖 I have created a release \*beep\* \*boop\* ---## [2.10.0](https://www.github.com/googleapis/python-bigquery/compare/v2.9.0...v2.10.0) (2021-02-25)### Features* add BIGNUMERIC support ([#527](https://www.github.com/googleapis/python-bigquery/issues/527)) ([cc3394f](https://www.github.com/googleapis/python-bigquery/commit/cc3394f80934419eb00c2029bb81c92a696e7d88))### Bug Fixes* error using empty array of structs parameter ([#474](https://www.github.com/googleapis/python-bigquery/issues/474)) ([c1d15f4](https://www.github.com/googleapis/python-bigquery/commit/c1d15f4e5da4b7e10c00afffd59a5c7f3ded027a))* QueryJob.exception() *returns* the errors, not raises them ([#467](https://www.github.com/googleapis/python-bigquery/issues/467)) ([d763279](https://www.github.com/googleapis/python-bigquery/commit/d7632799769248b09a8558ba18f5025ebdd9675a))### Documentation* **bigquery:** Add alternative approach to setting credentials ([#517](https://www.github.com/googleapis/python-bigquery/issues/517)) ([60fbf28](https://www.github.com/googleapis/python-bigquery/commit/60fbf287b0d34d5db2e61cce7a5b42735ed43d0e))* explain retry behavior for DONE jobs ([#532](https://www.github.com/googleapis/python-bigquery/issues/532)) ([696c443](https://www.github.com/googleapis/python-bigquery/commit/696c443f0a6740be0767e12b706a7771bc1460c3))---This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@plamutplamut deleted the iss-463 branchFebruary 26, 2021 07:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tswasttswasttswast approved these changes

@stephaniewang526stephaniewang526Awaiting requested review from stephaniewang526

Assignees

No one assigned

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support arrays of record/structs as query parameters

3 participants

@plamut@tswast@yoshi-kokoro

[8]ページ先頭

©2009-2025 Movatter.jp