cdm_reader_mapper.validate_id#
- cdm_reader_mapper.validate_id(data, imodel, blank=False, log_level='INFO')[source]#
Validate ID column(s) in a dataset against deck-specific patterns.
- Parameters:
data (
pd.DataFrame,pd.Series, orIterable[pd.DataFrame,pd.Series]) – Input dataset or series containing ID values.imodel (
str) – Name of internally available data model, e.g., “icoads_r300_d201”.blank (
bool, optional) – If True, empty values are considered valid. Default is False.log_level (
str, optional) – Logging level. Default is “INFO”.
- Returns:
pd.SeriesorNone– Boolean Series indicating whether each ID is valid. Returns None if validation cannot be performed due to missing data, columns, or deck definitions.- Raises:
TypeError – If data is not a pd.DataFrame or a pd.Series or an Iterable[pd.DataFrame | pd.Series].
Value Error – If dataset imodel has no deck information. If no ID conversion columns found. If input deck is not defined in ID library files.
FilenotFounderror – If dataset imodel has no ID deck library.
Notes
Uses _get_id_col to determine which column(s) contain IDs.
Uses _get_patterns to get regex patterns for the deck.
Empty values match “^$” pattern if blank=True.