pandera.api.parsers.ColumnParserΒΆ
- class pandera.api.parsers.ColumnParser(*args, **kwargs)[source]ΒΆ
An object that knows how to produce a column.
ParsedColumn(parser=...)accepts a plain callable or an object implementing this protocol. The protocol exists so a parser can inspect the column it is filling (viabind) and so independent parsers that would otherwise each do their own work can be merged (viabatch_key).Methods
- batch_key(ctx)[source]ΒΆ
Group key for merging with sibling parsers, or
Noneto opt out.Parsers returning equal non-
Nonekeys are handed tobatchand compiled into a singleParsercovering all their targets.- Return type:
- bind(ctx)[source]ΒΆ
Return the function that produces this column.
Called once at schema-build time. Raising
SchemaInitErrorhere surfaces the problem before any data is touched.- Return type:
Callable