ds_provider_powerofficego_py_lib.dataset.utils¶
File: utils.py
Region: ds_provider_powerofficego_py_lib/dataset/utils
Shared helpers for PowerOfficeGo dataset reads.
Attributes¶
Functions¶
|
Normalize a PowerOffice list or |
|
Parse an ISO-8601 timestamp string to an aware UTC datetime for comparison. |
|
Return the original value that sorts last by parsed UTC |
|
Return the greatest watermark among observed values for the given strategy. |
|
Build a checkpoint dictionary for pagination / incremental state. |
|
Build PowerOfficeGo query params from dataset read settings. |
|
Build the PowerOfficeGo API URL for |
Module Contents¶
- ds_provider_powerofficego_py_lib.dataset.utils.logger¶
- ds_provider_powerofficego_py_lib.dataset.utils._PROVIDER_FILTER_KEYS¶
- ds_provider_powerofficego_py_lib.dataset.utils.records_from_body(body: Any) list[dict[str, Any]][source]¶
Normalize a PowerOffice list or
{data|value|values: [...]}payload to row dicts.
- ds_provider_powerofficego_py_lib.dataset.utils.parse_iso8601_timestamp(value: str) datetime.datetime[source]¶
Parse an ISO-8601 timestamp string to an aware UTC datetime for comparison.
Handles up to 7 digits of fractional seconds by truncating to 6 (Python max).
- ds_provider_powerofficego_py_lib.dataset.utils.greatest_time_field_value(values: collections.abc.Sequence[Any]) Any[source]¶
Return the original value that sorts last by parsed UTC
datetime.
- ds_provider_powerofficego_py_lib.dataset.utils.greatest_incremental_value(values: collections.abc.Sequence[Any], *, kind: str) Any | None[source]¶
Return the greatest watermark among observed values for the given strategy.
- ds_provider_powerofficego_py_lib.dataset.utils.build_checkpoint(last_page: int | None, last_modified_date: str | None) dict[str, Any][source]¶
Build a checkpoint dictionary for pagination / incremental state.
- ds_provider_powerofficego_py_lib.dataset.utils.build_params(settings: Any, page: int, last_modified_date: str | None, *, as_of: str | None = None) dict[str, Any][source]¶
Build PowerOfficeGo query params from dataset read settings.
as_ofsets TrialBalancedateand overridesfilters.date. Product-only filter keys (e.g.date_from) are not forwarded.LastChangedDateTimeOffsetis auto-added toFieldsfor incremental products only — TrialBalance rejects that field (HTTP 400).