audit_prune#

hydromodpy.audit_prune(workspace=None, *, apply=False)[source]#

Apply retention_policies to audit_log for the workspace catalog.

Return type:

dict[str, int]

Parameters:

Parameters#

workspace

Path to a workspace or project directory. Resolved via hydromodpy.cli.helpers.find_catalog_root() so any path under the project tree works. None resolves to the current directory.

apply

False (default) counts rows that would be removed without modifying the file. True actually deletes rows.

Returns#

dict[str, int]

Mapping event_type -> rows_affected. Empty when no retention policy is registered.

Raises#

FileNotFoundError

If the workspace does not host a catalog.duckdb.

param workspace:

type workspace:

Any

param apply:

type apply:

bool