Skip to content

Commit 71b7a63

Browse files
committed
Fixing missing assertTrue and reversion to not checking subset on append (both from rebase)
1 parent d3f4fb5 commit 71b7a63

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas_gbq/gbq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def to_gbq(dataframe, destination_table, project_id, chunksize=10000,
894894
connector.delete_and_recreate_table(
895895
dataset_id, table_id, table_schema)
896896
elif if_exists == 'append':
897-
if not connector.verify_schema(dataset_id, table_id, table_schema):
897+
if not connector.schema_is_subset(dataset_id, table_id, table_schema):
898898
raise InvalidSchema("Please verify that the structure and "
899899
"data types in the DataFrame match the "
900900
"schema of the destination table.")

pandas_gbq/tests/test_gbq.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,9 +1279,8 @@ def test_verify_schema_ignores_field_mode(self):
12791279
'type': 'TIMESTAMP'}]}
12801280

12811281
self.table.create(TABLE_ID + test_id, test_schema_1)
1282-
self.assertTrue(self.sut.verify_schema(
1283-
self.dataset_prefix + "1", TABLE_ID + test_id, test_schema_2),
1284-
'Expected schema to match')
1282+
assert self.sut.verify_schema(
1283+
self.dataset_prefix + "1", TABLE_ID + test_id, test_schema_2)
12851284

12861285
def test_retrieve_schema(self):
12871286
# For pull request #24

0 commit comments

Comments
 (0)