ds_provider_xledger_py_lib.serde¶
File: __init__.py
Region: ds_provider_xledger_py_lib/serde
Description¶
Serde helpers for the Xledger provider.
Submodules¶
Classes¶
Parse GraphQL responses into dataframes using operation metadata. |
|
Build GraphQL payloads from dataframe input and loaded metadata. |
Package Contents¶
- class ds_provider_xledger_py_lib.serde.XledgerDeserializer[source]¶
Bases:
ds_resource_plugin_py_lib.common.serde.deserialize.base.DataDeserializerParse GraphQL responses into dataframes using operation metadata.
- __call__(value: Any, **kwargs: Any) pandas.DataFrame[source]¶
Deserialize a GraphQL response body.
- Parameters:
value – GraphQL response body.
**kwargs – Compatibility kwargs. Requires
metadataandoperation_settings.
- Returns:
Parsed dataframe output.
- get_next(value: Any, **kwargs: Any) bool[source]¶
Return
hasNextPagefrom a read response payload.- Parameters:
value – GraphQL response body.
**kwargs – Compatibility kwargs. Requires
metadata.
- Returns:
Truewhen there is a next page.
- get_end_cursor(value: Any, **kwargs: Any) str | None[source]¶
Return last edge cursor from a read response payload.
- Parameters:
value – GraphQL response body.
**kwargs – Compatibility kwargs. Requires
metadata.
- Returns:
Last cursor when available, otherwise
None.
- get_incremental_watermark(value: Any, *, metadata: ds_provider_xledger_py_lib.utils.introspection.MetaData) Any[source]¶
Return the highest incremental field value from a read response.
Uses
metadata.incrementalfor the node field name and strategy (kind). When read metadata has no incremental section, returnsNonewithout inspecting the payload.- Parameters:
value – GraphQL response body.
metadata – Read operation metadata.
- Returns:
The highest field value found in the current page, or
Nonewhen incremental is not configured or the page has no comparable values.- Raises:
IncrementalFieldMissingException – If rows are present but the incremental field is missing from every returned node.
InvalidIncrementalWatermarkException – If watermark values are invalid for the configured strategy (via
greatest_incremental_value).UnsupportedIncrementalKindException – If incremental
kindis not supported (viagreatest_incremental_value).