enforce

enforce_tools

shekels.enforce.enforce_tools.enforce_columns_in_dataframe(columns, data)[source]

Ensure all given columns are in given dataframe columns.

Parameters:
  • columns (list[str]) – Column names.

  • data (DataFrame) – DataFrame.

Raises:

EnforceError – If any column not found in data.columns.

Return type:

None

shekels.enforce.enforce_tools.enforce_dataframes_are_equal(a, b)[source]

Endsures that DataFrames a and b have equal contents.

Parameters:
  • a (DataFrame) – DataFrame A.

  • b (DataFrame) – DataFrame B.

Raises:

EnforceError – If a and b are not equal.