Bob Colner
05/10/2022, 4:14 PMprefect-gcp
issue using the bigquery_insert_stream
task. I’m not able to pass Timestamp
data-types -getting: TypeError: Object of type Timestamp is not JSON serializable
Timestamp
as an iso formatted string -hope this ends up in bigquery as a TimestampAndrew Huang
05/10/2022, 4:45 PM```python
from prefect import flow
from prefect_gcp import GcpCredentials
from prefect_gcp.bigquery import bigquery_insert_stream
from google.cloud.bigquery import SchemaField
@flow
def example_bigquery_insert_stream_flow():
gcp_credentials = GcpCredentials(project="project")
records = [
{"timestamp": "2022-02-03 10:00", "text": "abc", "bool": True},
]
result = bigquery_insert_stream(
dataset="integrations",
table="test_table",
records=records,
gcp_credentials=gcp_credentials
)
return result
Bob Colner
05/10/2022, 5:00 PMbiquery_insert_stream