Title: _from_api_repr_scalar fails, if parameter value is None · Issue #422 · googleapis/python-bigquery · GitHub
Open Graph Title: _from_api_repr_scalar fails, if parameter value is None · Issue #422 · googleapis/python-bigquery
X Title: _from_api_repr_scalar fails, if parameter value is None · Issue #422 · googleapis/python-bigquery
Description: Tested on latest (2.6.0) version, using python 3.8 on linux. If ArrayQueryParameter contaning at least one None value is added to query_parameters, when using job.query_parameters (result after submitting the job) 'NoneType' object has n...
Open Graph Description: Tested on latest (2.6.0) version, using python 3.8 on linux. If ArrayQueryParameter contaning at least one None value is added to query_parameters, when using job.query_parameters (result after sub...
X Description: Tested on latest (2.6.0) version, using python 3.8 on linux. If ArrayQueryParameter contaning at least one None value is added to query_parameters, when using job.query_parameters (result after sub...
Opengraph URL: https://github.com/googleapis/python-bigquery/issues/422
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"_from_api_repr_scalar fails, if parameter value is None","articleBody":"Tested on latest (2.6.0) version, using python 3.8 on linux.\r\n\r\nIf `ArrayQueryParameter` contaning at least one `None` value is added to `query_parameters`, when using `job.query_parameters` (result after submitting the job) `'NoneType' object has no attribute 'mode'` will be raised.\r\n\r\nThis is because:\r\n- `_from_api_repr_scalar` is called on `ArrayQueryParameter`\r\n- `_QUERY_PARAMS_FROM_JSON[array_type](value, None) for value in values`, the `value` is None\r\n- this corresponds to `_int_from_json(None, None)`\r\n- `_not_null(None, None)` is called\r\n- `return value is not None or field.mode != \"NULLABLE\"` raises exception\r\n\r\nStack trace:\r\n```\r\nAttributeError: 'NoneType' object has no attribute 'mode'\r\n (snip)\r\n File \"(snip)/site-packages/google/cloud/bigquery/job/query.py\", line 632, in query_parameters\r\n return self._configuration.query_parameters\r\n File \"(snip)/site-packages/google/cloud/bigquery/job/query.py\", line 314, in query_parameters\r\n return _from_api_repr_query_parameters(prop)\r\n File \"(snip)/site-packages/google/cloud/bigquery/job/query.py\", line 79, in _from_api_repr_query_parameters\r\n return [_query_param_from_api_repr(mapping) for mapping in resource]\r\n File \"(snip)/site-packages/google/cloud/bigquery/job/query.py\", line 79, in \u003clistcomp\u003e\r\n return [_query_param_from_api_repr(mapping) for mapping in resource]\r\n File \"(snip)/site-packages/google/cloud/bigquery/query.py\", line 632, in _query_param_from_api_repr\r\n return klass.from_api_repr(resource)\r\n File \"(snip)/site-packages/google/cloud/bigquery/query.py\", line 257, in from_api_repr\r\n return cls._from_api_repr_scalar(resource)\r\n File \"(snip)/site-packages/google/cloud/bigquery/query.py\", line 239, in _from_api_repr_scalar\r\n converted = [\r\n File \"(snip)/site-packages/google/cloud/bigquery/query.py\", line 240, in \u003clistcomp\u003e\r\n _QUERY_PARAMS_FROM_JSON[array_type](value, None) for value in values\r\n File \"(snip)/site-packages/google/cloud/bigquery/_helpers.py\", line 48, in _int_from_json\r\n if _not_null(value, field):\r\n File \"(snip)/site-packages/google/cloud/bigquery/_helpers.py\", line 43, in _not_null\r\n return value is not None or field.mode != \"NULLABLE\"\r\n```\r\n","author":{"url":"https://github.com/peku33","@type":"Person","name":"peku33"},"datePublished":"2020-12-08T13:30:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/422/python-bigquery/issues/422"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3580ffd9-2bb5-9cf6-4e3d-8f3df31722dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A83A:2FEA35:1AB52DE:24B4CA6:6A4EB331 |
| html-safe-nonce | 871723edefa8b9240f719c3d14aaecbf4aa76111b138be5343b4d6c300597619 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODNBOjJGRUEzNToxQUI1MkRFOjI0QjRDQTY6NkE0RUIzMzEiLCJ2aXNpdG9yX2lkIjoiMjU0Mzc4OTc5NTUzODAyMzIxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b3fe0fb6f11daae51ee8fcd93a26be5877ecf8768a28662865afda9548446a0 |
| hovercard-subject-tag | issue:759447718 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-bigquery/422/issue_layout |
| twitter:image | https://opengraph.githubassets.com/da7c77518c46155b82b81260f3222594c3df11dff92c4c3b49a8291ef841afe8/googleapis/python-bigquery/issues/422 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da7c77518c46155b82b81260f3222594c3df11dff92c4c3b49a8291ef841afe8/googleapis/python-bigquery/issues/422 |
| og:image:alt | Tested on latest (2.6.0) version, using python 3.8 on linux. If ArrayQueryParameter contaning at least one None value is added to query_parameters, when using job.query_parameters (result after sub... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | peku33 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-bigquery git https://github.com/googleapis/python-bigquery.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992475 |
| octolytics-dimension-repository_nwo | googleapis/python-bigquery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992475 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-bigquery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width