Skip to content

Commit d0f83df

Browse files
authored
add TIMESTAMP column to pandas upload example (#2617)
* add TIMESTAMP column to pandas upload example So long as NULLs are not present, the pandas dtype to BigQuery data type auto conversion should work as intended. * tests: specify session py2 instead of py2-2.7
1 parent 9582dbc commit d0f83df

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.kokoro/python2.7/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ action {
3939
# Specify which tests to run
4040
env_vars: {
4141
key: "RUN_TESTS_SESSION"
42-
value: "py2-2.7"
42+
value: "py2"
4343
}

bigquery/pandas-gbq-migration/samples_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ def test_client_library_upload_from_dataframe(temp_dataset):
216216
'my_string': ['a', 'b', 'c'],
217217
'my_int64': [1, 2, 3],
218218
'my_float64': [4.0, 5.0, 6.0],
219+
'my_timestamp': [
220+
pandas.Timestamp("1998-09-04T16:03:14"),
221+
pandas.Timestamp("2010-09-13T12:03:45"),
222+
pandas.Timestamp("2015-10-02T16:00:00")
223+
],
219224
}
220225
)
221226
client = bigquery.Client()
@@ -254,6 +259,11 @@ def test_pandas_gbq_upload_from_dataframe(temp_dataset):
254259
'my_string': ['a', 'b', 'c'],
255260
'my_int64': [1, 2, 3],
256261
'my_float64': [4.0, 5.0, 6.0],
262+
'my_timestamp': [
263+
pandas.Timestamp("1998-09-04T16:03:14"),
264+
pandas.Timestamp("2010-09-13T12:03:45"),
265+
pandas.Timestamp("2015-10-02T16:00:00")
266+
],
257267
}
258268
)
259269
table_id = 'my_dataset.new_table'

0 commit comments

Comments
 (0)