RRap0so commented on code in PR #35459:
URL: https://github.com/apache/beam/pull/35459#discussion_r2178252239


##########
sdks/python/apache_beam/io/avroio.py:
##########
@@ -554,11 +554,11 @@ def avro_union_type_to_beam_type(union_type: List) -> 
schema_pb2.FieldType:
   """
   if len(union_type) == 2 and "null" in union_type:
     for avro_type in union_type:
-      if avro_type in AVRO_PRIMITIVES_TO_BEAM_PRIMITIVES:
-        return schema_pb2.FieldType(
-            atomic_type=AVRO_PRIMITIVES_TO_BEAM_PRIMITIVES[avro_type],
-            nullable=True)
-    return schemas.typing_to_runner_api(Any)
+      if avro_type != "null":
+        beam_type = avro_type_to_beam_type(avro_type)
+        if beam_type.WhichOneof("type_info") == "atomic_type":
+          return schema_pb2.FieldType(
+              atomic_type=beam_type.atomic_type, nullable=True)

Review Comment:
   All done, also had to tweak a test but seems like it's all working as 
intended.



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to