Capability Save & Persist

class ds_capability.components.abstract_common_component.AbstractCommonComponent(property_manager: Any, intent_model: Any, default_save: bool | None = None, reset_templates: bool | None = None, template_path: str | None = None, template_module: str | None = None, template_source_handler: str | None = None, template_persist_handler: str | None = None, align_connectors: bool | None = None)

An abstract common component class that contains the methods shared across all capabilities. This allows all capability instances to share common behavior in initialization, connectivity management, reporting and running the component.

load_canonical(connector_name: str, reset_changed: bool | None = None, has_changed: bool | None = None, return_empty: bool | None = None, **kwargs) Table

returns the canonical of the referenced connector

Parameters:
  • connector_name – the name or label to identify and reference the connector

  • reset_changed – (optional) resets the has_changed boolean to True

  • has_changed – (optional) tests if the underline canonical has changed since last load else error returned

  • return_empty – (optional) if has_changed is set, returns an empty canonical if set to True

  • kwargs – arguments to be passed to the handler on load

load_persist_canonical(reset_changed: bool | None = None, has_changed: bool | None = None, return_empty: bool | None = None, **kwargs) Table

loads the clean pandas.DataFrame from the clean folder for this contract

Parameters:
  • reset_changed – (optional) resets the has_changed boolean to True

  • has_changed – (optional) tests if the underline canonical has changed since last load else error returned

  • return_empty – (optional) if has_changed is set, returns an empty canonical if set to True

  • kwargs – arguments to be passed to the handler on load

load_source_canonical(reset_changed: bool | None = None, has_changed: bool | None = None, return_empty: bool | None = None, **kwargs) Table

returns the contracted source data as a DataFrame

Parameters:
  • reset_changed – (optional) resets the has_changed boolean to True

  • has_changed – (optional) tests if the underline canonical has changed since last load else error returned

  • return_empty – (optional) if has_changed is set, returns an empty canonical if set to True

  • kwargs – arguments to be passed to the handler on load

save_canonical(connector_name: str, canonical: Any, **kwargs)

saves the canonical to the referenced connector. Same as persist_canonical

Parameters:
  • connector_name – the name or label to identify and reference the connector

  • canonical – the canonical data to persist

  • kwargs – arguments to be passed to the handler on persist

save_persist_canonical(canonical, auto_connectors: bool | None = None, **kwargs)

Saves the canonical to the clean files folder, auto creating the connector from template if not set