-
Notifications
You must be signed in to change notification settings - Fork 125
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
append to table with DATETIME column with generated schema #450
Comments
Currently, this failure happens locally due to generated schema != server-side schema. Even without that client-side check, I think this failure could still happen with |
Actually, there is a workaround. The user can manually specify a schema if they want DATETIME instead of TIMESTAMP. ...
pandas_gbq.to_gbq(
df,
destination,
if_exists="append",
table_schema=[
{"name": "row_num", "type": "INTEGER"},
{"name": "some_datetime", "type": "DATETIME"},
]
) I might change this to a Feature Request, as I believe this is a known way of dealing with the ambiguity between TIMESTAMP and DATETIME. |
+1 for DateTime support instead of just Timestamp. Currently all my DateTime columns are being uploaded as Timestamps with the to_gbq function unless I specify the column is of type 'DATETIME' with the table_schema argument. |
This should be working now with pandas datetime64 dtypes by looking for a timezone. If a timezone is present, use TIMESTAMP, otherwise use DATETIME. Still needs a follow-up to do the same for ArrowDtype (needed for bigframes). |
Steps to reproduce
Code example
Stack trace
The text was updated successfully, but these errors were encountered: