Skip to content

Commit

Permalink
fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
treff7es committed Oct 3, 2023
1 parent 071526d commit c335212
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BigqueryTableIdentifier:
_BQ_SHARDED_TABLE_SUFFIX: str = "_yyyymmdd"

@staticmethod
def get_table_and_shard(table_name: str) -> Tuple[str, Optional[str]]:
def get_table_and_shard(table_name: str) -> Tuple[Optional[str], Optional[str]]:
"""
Args:
table_name:
Expand All @@ -66,7 +66,7 @@ def get_table_and_shard(table_name: str) -> Tuple[str, Optional[str]]:
re.IGNORECASE,
)
if match:
shard = match[3]
shard: str = match[3]
if shard:
if table_name.endswith(shard):
new_table_name = table_name[: -len(shard)]
Expand All @@ -76,7 +76,7 @@ def get_table_and_shard(table_name: str) -> Tuple[str, Optional[str]]:
)
if new_table_name.endswith("."):
new_table_name = table_name
return new_table_name if new_table_name else None, shard
return (new_table_name, shard) if new_table_name else (None, shard)
return new_table_name, None

@classmethod
Expand Down

0 comments on commit c335212

Please sign in to comment.