lakehouse.utils.assertion

lakehouse.utils.assertion.assert_allowed_opts(options: Dict[str, Any], allowed_opts: List[str]) None

Function to assert that only allowed options are provided. If options are not in the allowed_opts list an AssertionError is raised.

Parameters:
  • options (Dict[str, Any]) – options provided

  • allowed_opts (List[str]) – allowed options

lakehouse.utils.assertion.assert_execute_options(load: bool, transform: bool, write: bool, tbl_properties: bool, optimize: bool) None

Function to assert the execute combinations

Parameters:
  • load (bool) – If load option defined

  • transform (bool) – If transform option defined

  • write (bool) – If write option defined

  • optimize (bool) – If optimize option defined

lakehouse.utils.assertion.assert_load_options(load_opts: Dict[str, Any]) None

Function to assert that the load options are valid.

Parameters:

load_opts (Dict[str, Any]) – load options

lakehouse.utils.assertion.assert_optimize_options(optimize_opts: Dict[str, Any]) None

Function to assert that the optimize options are valid

Parameters:

optimize_opts (Dict[str, Any]) – optimize options

lakehouse.utils.assertion.assert_required_opts(options: Dict[str, Any], required_opts: List[str]) None

Function to assert that all required options are provided. If a required option is missing in options an AssertionError is raised.

Parameters:
  • options (Dict[str, Any]) – options provided

  • required_opts (List[str]) – required options

lakehouse.utils.assertion.assert_tblproperties(tbl_properties: Dict[str, Any]) None

Function to assert that the optimize options are valid

Parameters:

optimize_opts (Dict[str, Any]) – optimize options

lakehouse.utils.assertion.assert_transform_functions(self, funcs: List[str]) None

Function to assert that the transform functions are valid.

Parameters:
  • instance (Callable) – instance

  • funcs (List[str]) – defined functions

lakehouse.utils.assertion.assert_transform_options(transform_opts: Dict[str, Any], self) None

Function to assert that the transform options are valid.

Parameters:

transform_opts (Dict[str, Any]) – transform options

lakehouse.utils.assertion.assert_write_options(write_opts: Dict[str, Any]) None

Function to assert that the write options are valid.

Parameters:

write_opts (Dict[str, Any]) – write options