chamikaramj commented on a change in pull request #17153:
URL: https://github.com/apache/beam/pull/17153#discussion_r833598733



##########
File path: sdks/python/apache_beam/io/gcp/bigquery.py
##########
@@ -657,6 +658,22 @@ def reader(self, test_bigquery_client=None):
         kms_key=self.kms_key)
 
 
+class _BigQueryExportResult:
+  def __init__(self, schema, metadata_list):
+    self.schema = schema
+    self.metadata_list = metadata_list
+
+  # Store schema as JSON string since TableSchema objects cannot be pickled.
+  @property
+  @functools.lru_cache()
+  def schema(self):
+    return bigquery_tools.parse_table_schema_from_json(self._schema)
+
+  @schema.setter
+  def schema(self, value):
+    self._schema = json.dumps(bigquery_tools.table_schema_to_dict(value))

Review comment:
       As a higher level point though. I think all state of a source object 
being packable (including temporary state) is not a guarantee we provide and it 
will be very difficult to guarantee this behavior in the future for BQ and 
other sources. Also that can make source implementations more restrictive.




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

To unsubscribe, e-mail: [email protected]

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


Reply via email to