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

Marshal row data correctly in 'Table.insert_data()' #3426

Merged
merged 4 commits into from
May 18, 2017
Merged

Marshal row data correctly in 'Table.insert_data()' #3426

merged 4 commits into from
May 18, 2017

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented May 16, 2017

Closes #2957.

@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 May 16, 2017
@tseaver tseaver requested a review from dhermes May 16, 2017 20:57
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 16, 2017
:returns: A tuple of data converted to native types.
"""
row_data = []
for field, cell in zip(schema, row['f']):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

"""Convert JSON row data to rows with appropriate types."""
return [_row_from_json(row, schema) for row in rows]
# Converters used for scalar values marshalled as query parameters.
_SCALAR_VALUE_TO_JSON_PARM = _SCALAR_VALUE_TO_JSON_ROW.copy()

This comment was marked as spam.

# Specifies the number of seconds since the epoch.
value = _convert_timestamp(value)
converter = _SCALAR_VALUE_TO_JSON_ROW.get(field.field_type)
if converter is not None:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@tseaver tseaver merged commit 9220dac into googleapis:master May 18, 2017
@tseaver tseaver deleted the 2957-bigquery-table_insert_data-marshalling branch May 18, 2017 19:00
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.

5 participants