import re


def construct_bq_table_path(project: str, dataset: str, table_name: str) -> str:
  """Constructs BQ table path from path components for BQ airflow operator.

  Args:
    project: BigQuery project id.
    dataset: BigQuery dataset name.
    table_name: BigQuery table name.

  Returns:
    Full path to BigQuery table in the format:
    <project>.<dataset>.<table_name>

  Raises:
    ValueError if incorrect names is provided.
  """
  if (not re.match(r'^[\w\-]+$', project)) or (not re.match(
      r'^\w+$', dataset)) or (not re.match(r'^\w+$', table_name)):
    raise ValueError(
        f'Project={project}, Dataset={dataset} and Table_Name = {table_name} '
        'should contain only letters, numbers and underscore.')

  return '{}.{}.{}'.format(project, dataset, table_name)