tlc.core.utils.string_validation
¶
Utilities for validating strings.
A collection of functions taking a single string argument which raise if the string does not adhere to the requirements for the specific function.
Module Contents¶
Functions¶
Function |
Description |
---|---|
Validate a project name. |
|
Validate a dataset name. |
|
Validate a table name. |
|
Validate a run name. |
|
Validate a column name. |
|
Validate a map element name. |
|
Warn if a column name is invalid. |
|
Warn if a map element name is invalid. |
API¶
- tlc.core.utils.string_validation.validate_project_name(name: str) None ¶
Validate a project name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.validate_dataset_name(name: str) None ¶
Validate a dataset name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.validate_table_name(name: str) None ¶
Validate a table name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.validate_run_name(name: str) None ¶
Validate a run name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.validate_column_name(name: str) None ¶
Validate a column name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.validate_map_element_name(name: str) None ¶
Validate a map element name.
Raises a ValueError if the name contains any illegal characters.
- Parameters:
name – The name to validate.
- Raises:
ValueError – If the name contains any illegal characters.
- tlc.core.utils.string_validation.warn_if_invalid_column_name(name: str) None ¶
Warn if a column name is invalid.
This function exists for backwards compatibility with tables created before the introduction of the column name validation. It will log a warning if the column name is invalid, but will not raise an error.
- Parameters:
name – The name to validate.
- tlc.core.utils.string_validation.warn_if_invalid_map_element_name(name: str) None ¶
Warn if a map element name is invalid.
This function exists for backwards compatibility with tables created before the introduction of the map element name validation. It will log a warning if the map element name is invalid, but will not raise an error.
- Parameters:
name – The name to validate.