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



##########
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:
       I think you can limit calling `_is_table_empty` for only when the 
disposition is `WRITE_EMPTY`.




----------------------------------------------------------------
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