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



##########
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:
       Seems like the types are also different ? Input is a 
bigquery.TableSchema object and output is JSON dict. I would implement new 
functions here without depending on existing functions and add extensive 
testing to make sure that this is valid/correct for various 
bigquery.TableSchema objects.




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