pabloem commented on a change in pull request #13490:
URL: https://github.com/apache/beam/pull/13490#discussion_r537664459



##########
File path: sdks/python/apache_beam/io/gcp/bigquery_tools.py
##########
@@ -924,7 +924,8 @@ def get_or_create_table(
 
     # If table exists already then handle the semantics for WRITE_EMPTY and
     # WRITE_TRUNCATE write dispositions.
-    if found_table:
+    if found_table and write_disposition in (
+        BigQueryDisposition.WRITE_EMPTY, BigQueryDisposition.WRITE_TRUNCATE):
       table_empty = self._is_table_empty(project_id, dataset_id, table_id)

Review comment:
       good catch. LMK if it looks better now.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to