def __init__(self, schemas):
        """Initializes a new union schema object.

        Args:
          schemas: Ordered collection of schema branches in the union.
        """
        super(UnionSchema, self).__init__(data_type=UNION)
        self._schemas = tuple(schemas)

        # Validate the schema branches:

        # All named schema names are unique:
        named_branches = tuple(
            filter(lambda schema: schema.type in NAMED_TYPES, self._schemas))
        unique_names = frozenset(map(lambda schema: schema.fullname, named_branches))
        if len(unique_names) != len(named_branches):
            schemas = ''.join(map(lambda schema: (f'\n\t - {schema}'), self._schemas))
            raise AvroException(f'Invalid union branches with duplicate schema name:{schemas}')

        # Types are unique within unnamed schemas, and union is not allowed:
        unnamed_branches = tuple(
            filter(lambda schema: schema.type not in NAMED_TYPES, self._schemas))
        unique_types = frozenset(map(lambda schema: schema.type, unnamed_branches))
        if UNION in unique_types:
            schemas = ''.join(map(lambda schema: (f'\n\t - {schema}'), self._schemas))
            raise AvroException(f'Invalid union branches contain other unions:{schemas}')
        if len(unique_types) != len(unnamed_branches):
            schemas = ''.join(map(lambda schema: (f'\n\t - {schema}'), self._schemas))
            raise AvroException(f'Invalid union branches with duplicate type:{schemas}')
Initializes a new union schema object.

        Args:
          schemas: Ordered collection of schema branches in the union.
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/storage/blob/_shared/avro/schema.py