Skip to content

fix: to_gbq allows strings for DATE and floats for NUMERIC, require pandas 0.24+ and db-dtypes #423

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

Merged
merged 22 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/requirements-3.7-0.23.2.conda
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
codecov
coverage
db-dtypes==0.3.0
fastavro
flake8
numpy==1.16.6
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-3.9-NIGHTLY.conda
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
db-dtypes
pydata-google-auth
google-cloud-bigquery
google-cloud-bigquery-storage
Expand Down
2 changes: 1 addition & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
templated_files = common.py_library(
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10"],
system_test_python_versions=["3.7", "3.8", "3.9", "3.10"],
cov_level=86,
cov_level=88,
unit_test_extras=extras,
system_test_extras=extras,
intersphinx_dependencies={
Expand Down
3 changes: 2 additions & 1 deletion pandas_gbq/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def cast_dataframe_for_parquet(
column_type = column.get("type", "").upper()
if (
column_type == "DATE"
and dataframe[column_name].dtype != db_dtypes.DateDtype()
# Use extension dtype first so that it uses the correct equality operator.
and db_dtypes.DateDtype() != dataframe[column_name].dtype
):
# Construct converted column manually, because I can't use
# .astype() with DateDtype. With .astype(), I get the error:
Expand Down