Skip to content

Using string array with magic block results in whitespace removal from first entry of the array #166

@amardeep

Description

@amardeep

On passing a dict { 'cats': ['apple orange', 'pear plum']} as params in bigquery magic cell, the first value is changed to appleorange - the space character is filtered out.

Environment details

  • OS type and version: colab
  • Python version: Python 3.6.9
  • pip version: 19.3.1
  • google-cloud-bigquery version: 1.21.0

Steps to reproduce

A colab notebook illustrating the error:
https://colab.research.google.com/gist/amardeep/63ec303ba8bac3db9849f4044cd19ff1/test-bigquery-array-parameter-bug.ipynb

Code example

params = {
    'cats': ['apple orange', 'pear plum']
}

%%bigquery  --params $params
SELECT * FROM UNNEST(@cats)

This results in the output:

           f0_
0  appleorange
1    pear plum

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions