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

Conform to expected wire format for struct query parameters. #2892

Merged
merged 2 commits into from
Dec 21, 2016
Merged

Conform to expected wire format for struct query parameters. #2892

merged 2 commits into from
Dec 21, 2016

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Dec 20, 2016

Closes: #2887.

/cc @tswast

@tseaver tseaver added api: bigquery Issues related to the BigQuery API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 20, 2016
@tseaver tseaver requested a review from dhermes December 20, 2016 21:19
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 20, 2016
@tseaver tseaver requested a review from daspecster December 20, 2016 21:19
@@ -1188,13 +1196,17 @@ def test_from_api_repr_w_name(self):
def test_from_api_repr_wo_name(self):
RESOURCE = {
'parameterType': {
'type': 'STRUTCT',

This comment was marked as spam.

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

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

I defer to @tswast on the correctness of this

@@ -554,10 +555,12 @@ def from_api_repr(cls, resource):
instance = cls(name)
types = instance.struct_types
for item in resource['parameterType']['structTypes']:
types[item['name']] = item['type']
types[item['name']] = item['type']['type']

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -568,18 +571,19 @@ def to_api_repr(self):
:returns: JSON mapping
"""
types = [
{'name': key, 'type': value}
{'name': key, 'type': {'type': value}}

This comment was marked as spam.

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -554,10 +555,12 @@ def from_api_repr(cls, resource):
instance = cls(name)
types = instance.struct_types
for item in resource['parameterType']['structTypes']:
types[item['name']] = item['type']
types[item['name']] = item['type']['type']

This comment was marked as spam.

@@ -554,10 +555,12 @@ def from_api_repr(cls, resource):
instance = cls(name)
types = instance.struct_types
for item in resource['parameterType']['structTypes']:
types[item['name']] = item['type']
types[item['name']] = item['type']['type']

This comment was marked as spam.

@tseaver tseaver merged commit 455eaf6 into googleapis:master Dec 21, 2016
@tseaver tseaver deleted the 2887-bigquery-struct-query-parm branch December 21, 2016 18:18
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…query-parm

Conform to expected wire format for struct query parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants