You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by GitBox <gi...@apache.org> on 2020/03/04 18:25:24 UTC

[GitHub] [beam] pabloem commented on a change in pull request #11040: [BEAM-9305] Allow value provider query strings in _CustomBigQuerySource

pabloem commented on a change in pull request #11040: [BEAM-9305] Allow value provider query strings in _CustomBigQuerySource
URL: https://github.com/apache/beam/pull/11040#discussion_r387850061
 
 

 ##########
 File path: sdks/python/apache_beam/io/gcp/bigquery.py
 ##########
 @@ -644,6 +644,8 @@ def estimate_size(self):
           self.table_reference.tableId)
       return int(table.numBytes)
     else:
+      if isinstance(self.query, ValueProvider):
+        self.query = self.query.get()
 
 Review comment:
   I would probably do this without changing the class variable.
   
   I'd do a local variable: `query = self.query.get()`, and do it on every instance where `self.query` is accessed.
   
   The reason is that the Source objects may be recreated in different workers, and the  `self.query` variable would contain the original ValueProvider in all of those.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services