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_project_name

Validate a project name.

validate_dataset_name

Validate a dataset name.

validate_table_name

Validate a table name.

validate_run_name

Validate a run name.

validate_column_name

Validate a column name.

validate_map_element_name

Validate a map element name.

warn_if_invalid_column_name

Warn if a column name is invalid.

warn_if_invalid_map_element_name

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.