Skip to content

Commit b933dfc

Browse files
committed
Fix unit test. Blacken
1 parent 7db8b1f commit b933dfc

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/system/test_gbq.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ def test_should_properly_handle_timestamp_unix_epoch(self, project_id):
315315
dtype="datetime64[ns]",
316316
)
317317
if expected["unix_epoch"].dt.tz is None:
318-
expected["unix_epoch"] = expected["unix_epoch"].dt.tz_localize("UTC")
318+
expected["unix_epoch"] = expected["unix_epoch"].dt.tz_localize(
319+
"UTC"
320+
)
319321
tm.assert_frame_equal(df, expected)
320322

321323
def test_should_properly_handle_arbitrary_timestamp(self, project_id):

tests/unit/test_gbq.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def no_auth(monkeypatch):
9595
("INTEGER", None), # Can't handle NULL
9696
("BOOLEAN", None), # Can't handle NULL
9797
("FLOAT", numpy.dtype(float)),
98+
# TIMESTAMP will be localized after DataFrame construction.
99+
("TIMESTAMP", "datetime64[ns]"),
98100
("DATETIME", "datetime64[ns]"),
99101
],
100102
)
@@ -108,16 +110,6 @@ def test_should_return_bigquery_correctly_typed(type_, expected):
108110
assert result == {"x": expected}
109111

110112

111-
def test_should_return_bigquery_correctly_typed_timestamp():
112-
result = gbq._bqschema_to_nullsafe_dtypes(
113-
[dict(name="x", type="TIMESTAMP", mode="NULLABLE")]
114-
)
115-
if pandas_installed_version < pkg_resources.parse_version("0.24.0"):
116-
assert result == {"x": "datetime64[ns]"}
117-
else:
118-
assert result == {"x": "datetime64[ns, UTC]"}
119-
120-
121113
def test_to_gbq_should_fail_if_invalid_table_name_passed():
122114
with pytest.raises(gbq.NotFoundException):
123115
gbq.to_gbq(DataFrame([[1]]), "invalid_table_name", project_id="1234")

0 commit comments

Comments
 (0)