TheNeuralBit commented on code in PR #23070:
URL: https://github.com/apache/beam/pull/23070#discussion_r989325298


##########
sdks/python/apache_beam/io/gcp/bigquery_schema_tools_test.py:
##########
@@ -61,6 +61,25 @@ def test_check_conversion_with_empty_schema(self):
         the_table_schema=schema)
     self.assertEqual(usertype.__annotations__, {})
 
+  def test_check_schema_conversions_with_timestamp(self):
+    fields = [
+        bigquery.TableFieldSchema(name='stn', type='STRING', mode="NULLABLE"),
+        bigquery.TableFieldSchema(name='temp', type='FLOAT64', 
mode="REPEATED"),
+        bigquery.TableFieldSchema(
+            name='times', type='TIMESTAMP', mode="NULLABLE")
+    ]
+    schema = bigquery.TableSchema(fields=fields)
+
+    usertype = bigquery_schema_tools.generate_user_type_from_bq_schema(
+        the_table_schema=schema)
+    self.assertEqual(
+        usertype.__annotations__,
+        {
+            'stn': typing.Optional[str],
+            'temp': typing.Sequence[np.float64],
+            'times': typing.Any

Review Comment:
   It looks like somewhere we're creating a type 
`Optional[Timestamp.from_utc_datetime]`, which is not a real typehint, as 
Valentyn indicated it should be `Optional[Timestamp]`



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