-
Notifications
You must be signed in to change notification settings - Fork 322
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.
Description
Environment details
Colab (Ubuntu 18.04 LTS, Python 3.6.9, pip 19.3.1, bigquery 1.21.0)
Issue/ Example
For a parameterised query, the magic fails to parse negative numbers.
For example, this parameter dict:
params = {
"threshold": -5.0,
"min_year": 2000
}
and this query:
%%bigquery --project my-project-name --params $params
SELECT
year, MIN(mean_temp) as min, COUNTIF(snow) / COUNT(snow) * 100 AS pc_snowing
FROM
`bigquery-public-data.samples.gsod`
WHERE mean_temp < @threshold
AND year >= @min_year
GROUP BY year
ORDER BY year
runs fine if threshold is >= 0, but if it's negative, the Magic gets an exception:
UsageError: unrecognized arguments: -5.0, 'min_year': 2000}
This happens whether it's a dictionary or a JSON string, and happens with ints as well as floats.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.