@@ -95,6 +95,8 @@ def no_auth(monkeypatch):
95
95
("INTEGER" , None ), # Can't handle NULL
96
96
("BOOLEAN" , None ), # Can't handle NULL
97
97
("FLOAT" , numpy .dtype (float )),
98
+ # TIMESTAMP will be localized after DataFrame construction.
99
+ ("TIMESTAMP" , "datetime64[ns]" ),
98
100
("DATETIME" , "datetime64[ns]" ),
99
101
],
100
102
)
@@ -108,16 +110,6 @@ def test_should_return_bigquery_correctly_typed(type_, expected):
108
110
assert result == {"x" : expected }
109
111
110
112
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
-
121
113
def test_to_gbq_should_fail_if_invalid_table_name_passed ():
122
114
with pytest .raises (gbq .NotFoundException ):
123
115
gbq .to_gbq (DataFrame ([[1 ]]), "invalid_table_name" , project_id = "1234" )
0 commit comments