local
State client for the local filesystem.
LocalStateClient
¶
Bases: StateClient
Read and write state as JSON files on the local filesystem.
The path argument is interpreted as a filesystem path (absolute or relative).
Source code in src/cloe_delta_table_manager/state/clients/local.py
read_state(path, state_type)
¶
Read state from a local JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Filesystem path to the JSON state file. |
required |
state_type
|
type[StateT]
|
The concrete State subclass to deserialize into. |
required |
Returns:
| Type | Description |
|---|---|
StateT
|
A State instance loaded from the file. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file does not exist. |
Source code in src/cloe_delta_table_manager/state/clients/local.py
state_exists(path)
¶
Check whether a state file exists on the local filesystem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Filesystem path to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the file exists, False otherwise. |
Source code in src/cloe_delta_table_manager/state/clients/local.py
write_state(path, state)
¶
Write state to a local JSON file.
Parent directories are created automatically if they do not exist. The version in the state metadata is incremented before writing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Filesystem path for the JSON state file. |
required |
state
|
State
|
The State instance to persist. |
required |