Skip to content

Conversation

@pcalcado
Copy link

@pcalcado pcalcado commented Sep 4, 2025

Avro import failed when array items used nullable union types like ["null", "string"]. The importer could handle field-level unions but not array item unions.

Little bug that is blocking our research on adopting data contracts at Braze, I think I got a fix.

Example failing schema:

  {
    "type": "array",
    "items": ["null", "string"]  // ← This caused "Unsupported type union" error, should return "string" and make it not required
  }

Solution:

  • Added union handling to import_avro_array_items() function
  • Extracted shared union logic into import_type_from_union_schema()
  • Reuses existing field-level union handling for consistency
  • Tests pass
  • ruff format
  • README.md updated (if relevant)
  •  CHANGELOG.md entry added

Copy link
Contributor

@jochenchrist jochenchrist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants