apache_beam.typehints.sharded_key_type module

Type constraint for ShardedKey.

Can be used like a type-hint, for instance,
‘ShardedKeyType[int]’ ‘ShardedKeyType[Tuple[T]]’

The type constraint is registered to be associated with apache_beam.coders.coders.ShardedKeyCoder. Mostly for internal use.

class apache_beam.typehints.sharded_key_type.ShardedKeyTypeConstraint(key_type)[source]

Bases: apache_beam.typehints.typehints.TypeConstraint

type_check(instance)[source]
match_type_variables(concrete_type)[source]
bind_type_variables(unused_bindings)
visit(visitor, visitor_arg)

Visitor method to visit all inner types of a composite type.

Parameters:
  • visitor – A callable invoked for all nodes in the type tree comprising a composite type. The visitor will be called with the node visited and the visitor argument specified here.
  • visitor_arg – Visitor callback second argument.
apache_beam.typehints.sharded_key_type.ShardedKeyType

alias of apache_beam.typehints.sharded_key_type.ShardedKeyTypeConstraint