-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.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.
Description
In my environment, I can't insert correct data to the TIMESTAMP column.
- gcloud 0.8.0
- Python 2.7.10
- MacOS X 10.10.5
The following snippet is the smallest reproducible example.
Please let me know that it's a bug or my mistake.
import os
from datetime import datetime
from gcloud import bigquery
GCP_KEY_PATH = os.path.join(os.path.dirname(__file__), './gcpkey.json')
project_id = 'my_project'
dataset = 'tmp'
table_name = 'test'
bq = bigquery.Client.from_service_account_json(GCP_KEY_PATH, project=project_id)
table = bq.dataset(dataset).table(name=table_name)
if not table.exists():
table.schema = [bigquery.SchemaField('time', 'TIMESTAMP')]
table.create()
table.reload()
rows = [[datetime.now()]]
table.insert_data(rows)Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.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.
