tylertreat/BigQuery-Python

Error if no insert id specified for push_rows

ddrazba-lytics opened this issue · 2 comments

File "seg_size_bq_dump.py", line 81, in <module> find_segments() File "seg_size_bq_dump.py", line 76, in find_segments save_segment_size_to_bq(a["aid"],a["name"],s["slug_name"],s["name"],s["id"],s["size"]) File "seg_size_bq_dump.py", line 36, in save_segment_size_to_bq inserted = client.push_rows('customer_success','segment_count_history', row) File "/Library/Python/2.7/site-packages/bigquery/client.py", line 909, in push_rows if insert_id_key in row: TypeError: coercing to Unicode: need string or buffer, NoneType found

Example with no 4th parameter:

inserted = client.push_rows('dataset','table', row)

What is row in your code? push_rows expects a list of dicts.

Thank you! You're right.