-
Notifications
You must be signed in to change notification settings - Fork 555
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
BigQueryV2: Allow passing an empty array as a value for params #4269
Conversation
@knu Thank you for submitting this pull request! |
Related issue in google-cloud-java? googleapis/google-cloud-java#2678 |
Thank you for your pull request. Unfortunately we have addressed this issue in a different manner. After discussions with the BigQuery team we have decided to add an optional data = dataset.query "SELECT name FROM my_table " \
"WHERE url IN UNNEST(@urls)",
params: { urls: [] },
types: { urls: [:STRING] } Users are also able to specify a non-STRING array: data = dataset.query "SELECT name FROM my_table " \
"WHERE id IN UNNEST(@ids)",
params: { ids: [] },
types: { ids: [:INT64] } |
@pdfabbro Did you intend to post this comment regarding googleapis/nodejs-bigquery here on a googleapis/google-cloud-ruby PR? |
I think maybe you should post it here? Sorry if I'm not understanding something about how this is relevant to the Ruby client. https://github.com/googleapis/nodejs-bigquery/issues |
Great, thanks. I'll verify your observations with the Ruby client and open a new issue for this repo (a sibling to the nodejs repo) if needed. Appreciate the heads up! |
The new issue related to null parameter values is googleapis/nodejs-bigquery#915. |
Currently passing an empty array causes the following error:
This is due to Convert.to_query_param trying to use the type of the first element as array_type without checking if a given array has an element.
This PR adds the necessary check.