nrel.hive.util.validation

Module Contents

Functions

validate_fields(row, expected)

checks whether all expected fields/columns exist on some mapping

Attributes

T

nrel.hive.util.validation.T
nrel.hive.util.validation.validate_fields(row: Mapping[str, T], expected: List[str])[source]

checks whether all expected fields/columns exist on some mapping

Parameters:
  • row – based off of row representations in DictReader, this is a mapping from column name to colunm value for a row

  • expected – the expected column names for this row

Raises:

ValueError – for all column names missing