Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest/bigquery): Remove table name restrictions (allow $ and @) #9030

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
from dataclasses import dataclass, field
from datetime import datetime
from typing import Any, ClassVar, Dict, List, Optional, Pattern, Set, Tuple, Union
from typing import Any, ClassVar, Dict, List, Optional, Pattern, Tuple, Union

from dateutil import parser

Expand Down Expand Up @@ -35,8 +35,6 @@ class BigqueryTableIdentifier:
dataset: str
table: str

invalid_chars: ClassVar[Set[str]] = {"$", "@"}

# Note: this regex may get overwritten by the sharded_table_pattern config.
# The class-level constant, however, will not be overwritten.
_BIGQUERY_DEFAULT_SHARDED_TABLE_REGEX: ClassVar[
Expand Down Expand Up @@ -105,18 +103,7 @@ def get_table_display_name(self) -> str:
)

table_name, _ = self.get_table_and_shard(shortened_table_name)
if not table_name:
table_name = self.dataset

# Handle exceptions
invalid_chars_in_table_name: List[str] = [
c for c in self.invalid_chars if c in table_name
]
if invalid_chars_in_table_name:
raise ValueError(
f"Cannot handle {self.raw_table_name()} - poorly formatted table name, contains {invalid_chars_in_table_name}"
)
return table_name
return table_name or self.dataset

def get_table_name(self) -> str:
"""
Expand Down