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

BigQuery: ArrayQueryParameter.from_api_repr fails with STRUCT query parameter values #4023

Closed
tswast opened this issue Sep 22, 2017 · 0 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tswast
Copy link
Contributor

tswast commented Sep 22, 2017

I encountered a system test error on the bigquery-b2 work when I modified some system tests to use QueryJob to pass in query parameters. The job resource that comes back cannot be parsed because of the query parameters in the query statistics.

The resource which is show the problem is this one:

    RESOURCE = {
        'parameterType': {
            'type': 'ARRAY',
            'arrayType': {
                'type': 'STRUCT',
                'structTypes': [
                    {
                        'name': 'name',
                        'type': {'type': 'STRING'}},
                    ,
                    {
                        'name': 'age',
                        'type': {'type': 'INT64'},
                    },
                ],
            },
        },
        'parameterValue': {
            'arrayValues': [
                {
                    'structValues': {
                        'name': {'value': 'Phred Phlyntstone'},
                        'age': {'value': '32'},
                    },
                },
                {
                    'structValues': {
                        'name': {
                            'value': 'Bharney Rhubbyl',
                        },
                        'age': {'value': '31'},
                    },
                },
            ],
        },
    }

I'm currently investigating a fix. Will make a PR to master rather than bigquery-b2 when ready because this issue will affect that branch too and I want a fix out possibly before Beta 2 is ready.

@tswast tswast 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 Sep 22, 2017
@tswast tswast self-assigned this Sep 22, 2017
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. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant