dlt.common.libs.pyarrow
TArrowPromoteOptions
How pyarrow.unify_schemas reconciles types that differ between schemas.
UnsupportedArrowTypeException Objects
class UnsupportedArrowTypeException(DltException)
Exception raised when Arrow type conversion failed.
The setters are used to update the exception with more context such as the relevant field and tablea it is caught downstream.
IncompatibleArrowFilesException Objects
class IncompatibleArrowFilesException(DltException, TerminalException)
Exception raised when schemas of local arrow files cannot be unified.
InvalidTimezoneException Objects
class InvalidTimezoneException(DltException)
Exception raised when arrow cannot resolve a timezone name.
PyToArrowConversionException Objects
class PyToArrowConversionException(DltException)
Exception raised when converting data to Arrow based on a TableSchema
ArrowSchemaNormalizationResult Objects
class ArrowSchemaNormalizationResult(NamedTuple)
Named result of should_normalize_arrow_schema
Fields:
- should_normalize: whether any normalization is required
- rename_mapping: mapping from original field names to normalized names
- rev_mapping: reverse mapping from normalized names to original
- nullable_updates: fields that require nullable flag updates (by normalized name)
- columns: potentially filtered/adjusted TTableSchemaColumns
get_column_timezone
def get_column_timezone(
column: TColumnType,
tz: str,
caps: DestinationCapabilitiesContext = None) -> Optional[str]
Timezone a timestamp column is stored in, None when the column is stored naive.
get_column_type_from_py_arrow
def get_column_type_from_py_arrow(dtype: pyarrow.DataType) -> TColumnType
Returns (data_type, precision, scale) tuple from pyarrow.DataType
py_arrow_to_table_schema_columns
def py_arrow_to_table_schema_columns(
schema: pyarrow.Schema) -> TTableSchemaColumns
Convert a PyArrow schema to a table schema columns dict.
Arguments:
schemapyarrow.Schema - pyarrow schema
Returns:
TTableSchemaColumns- table schema columns
get_nested_column_type_from_py_arrow
def get_nested_column_type_from_py_arrow(
dtype: pyarrow.DataType) -> TColumnType
Creates json dlt data type with nested type structure in x-nested-type hint.
Currently the only recognized nested type format is arrow-ipc