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:
[email protected]
With regards,
Apache Git Services