yggdrasil.arrow¶
arrow ¶
ensure_tzdata ¶
Make pyarrow's tzdata lookup succeed on Windows.
Returns True when a timezone-aware timestamp operation works at the
end of the call, False otherwise. No-op (returns True) on
non-Windows platforms and on repeat calls once a positive result has
been cached.
Parameters¶
force:
Bypass the cached positive result and rerun the probe + repair.
raise_on_failure:
Raise RuntimeError with manual-fix instructions when the final
canary still fails. Useful at the top of scripts/tests that depend
on timezone support.
default_arrow_scalar ¶
default_arrow_scalar(
dtype: Union[DataType, ListType, MapType, StructType, FixedSizeListType],
nullable: bool,
)
Return a default scalar for a given Arrow type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
Union[DataType, ListType, MapType, StructType, FixedSizeListType]
|
Arrow data type. |
required |
nullable
|
bool
|
Whether the scalar should be nullable. |
required |
Returns:
| Type | Description |
|---|---|
|
Arrow scalar default. |
default_python_scalar ¶
Return a default Python value for the given type hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
Any
|
Type hint to generate defaults for. |
required |
Returns:
| Type | Description |
|---|---|
|
Default Python value. |
default_scalar ¶
Return a default scalar value for Python or Arrow type hints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
Union[type, DataType, Field]
|
Python type or Arrow type/field. |
required |
nullable
|
bool | None
|
Override nullability for Arrow types. |
None
|
Returns:
| Type | Description |
|---|---|
|
Default scalar value. |