Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"setuptools",
"db-dtypes >=1.0.4,<2.0.0",
"numpy >=1.18.1",
"pandas >=1.1.4, <3.0.0",
"pandas >=1.1.4",
"pyarrow >=4.0.0",
"pydata-google-auth >=1.5.0",
"psutil >=5.9.8",
Expand Down
7 changes: 5 additions & 2 deletions tests/system/test_to_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_series_round_trip(
dtype="boolean",
),
"object_col": pandas.Series(
[False, None, True],
[False, pandas.NA, True],
dtype="object",
),
}
Expand Down Expand Up @@ -344,7 +344,10 @@ def test_series_round_trip(
# google-cloud-bigquery versions 1.x and 2.x, but not 3.x.
# https://github.com/googleapis/python-bigquery-pandas/issues/365
"datetime_col": [
datetime.datetime(1, 1, 1),
# CSV loader in BigQuery currently requires leading 0s
# for TIMESTAMP but not DATETIME. See internal issue
# b/467399807.
datetime.datetime(1000, 1, 1),
Comment on lines +347 to +350
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on lines 347-349 is a bit confusing. It states that the CSV loader's requirement for leading zeros applies to TIMESTAMP but not DATETIME. However, this change is made to datetime_col, which is defined as a DATETIME column in the table schema on line 374. Could you please clarify why this change is needed for a DATETIME column, or update the comment for future reference? This would help maintainers understand the reason for this specific test value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I use year >= 1000 so that no leading zeros are required.

datetime.datetime(1970, 1, 1),
datetime.datetime(9999, 12, 31, 23, 59, 59, 999999),
],
Expand Down