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


##########
sdks/python/apache_beam/io/avroio.py:
##########
@@ -554,11 +554,13 @@ 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:
   I think we probably just don't need this `if` branch at this point, right?
   
   The tests look good, so if removing this causes them to fail we can leave it 
for now, but I'd expect the logic after the `if` to do the same thing



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