ds_provider_xledger_py_lib.dataset.engines._read_incremental

Incremental read helpers for Xledger read execution.

Attributes

_LOGICAL_FILTER_KEYS

FilterDict

Functions

greatest_incremental_value(→ Any | None)

Return the greatest watermark among observed values for the given strategy.

_parse_iso8601_timestamp(→ datetime.datetime)

Parse an ISO-8601 timestamp string to an aware UTC datetime for comparison.

_greatest_time_field_value(→ Any)

Return the original value that sorts last by parsed UTC datetime.

compose_incremental_filter(→ FilterDict | None)

Apply checkpoint precedence for the incremental boundary.

remove_incremental_boundary(→ FilterDict | None)

Remove existing boundary clauses for the incremental field/operator.

Module Contents

ds_provider_xledger_py_lib.dataset.engines._read_incremental._LOGICAL_FILTER_KEYS = ('AND', 'OR')
ds_provider_xledger_py_lib.dataset.engines._read_incremental.FilterDict
ds_provider_xledger_py_lib.dataset.engines._read_incremental.greatest_incremental_value(values: collections.abc.Sequence[Any], *, kind: str) Any | None[source]

Return the greatest watermark among observed values for the given strategy.

Parameters:
  • values – Non-empty sequence of observed watermark candidates (nulls should be excluded by callers).

  • kind – Incremental strategy from metadata (e.g. time_field).

Returns:

The winning original value from values, or None when values is empty.

Raises:
ds_provider_xledger_py_lib.dataset.engines._read_incremental._parse_iso8601_timestamp(value: str) datetime.datetime[source]

Parse an ISO-8601 timestamp string to an aware UTC datetime for comparison.

ds_provider_xledger_py_lib.dataset.engines._read_incremental._greatest_time_field_value(values: collections.abc.Sequence[Any]) Any[source]

Return the original value that sorts last by parsed UTC datetime.

ds_provider_xledger_py_lib.dataset.engines._read_incremental.compose_incremental_filter(*, existing_filter: FilterDict | None, checkpoint: ds_provider_xledger_py_lib.dataset.engines._read_checkpoint.Checkpoint, incremental: ds_provider_xledger_py_lib.utils.introspection.IncrementalMetaData | None) FilterDict | None[source]

Apply checkpoint precedence for the incremental boundary.

Parameters:
  • existing_filter – User-provided filter from read settings.

  • checkpoint – Read checkpoint containing persisted continuation state.

  • incremental – Incremental section from read metadata, when configured.

Returns:

The effective filter with checkpoint boundary applied. When no incremental section or watermark exists, the original filter is returned unchanged.

ds_provider_xledger_py_lib.dataset.engines._read_incremental.remove_incremental_boundary(*, existing_filter: FilterDict | None, incremental: ds_provider_xledger_py_lib.utils.introspection.IncrementalMetaData) FilterDict | None[source]

Remove existing boundary clauses for the incremental field/operator.

Parameters:
  • existing_filter – User-provided filter from read settings.

  • incremental – Incremental section from read metadata.

Returns:

A cleaned filter where the incremental boundary for the configured filter key has been removed. Empty filters are returned as None.

Note

For and / or lists, nested filter objects are cleaned recursively. Non-mapping entries are passed through unchanged (order preserved).