Skip to content

Commit 3161fdf

Browse files
Fix types
1 parent dbcd5e8 commit 3161fdf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: singer_sdk/connectors/sql.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class FullyQualifiedName(UserString):
4848
def __init__(
4949
self,
5050
*,
51-
table: str | None = None,
51+
table: str,
5252
schema: str | None = None,
5353
database: str | None = None,
5454
delimiter: str = ".",
@@ -341,7 +341,7 @@ def get_fully_qualified_name(
341341
The fully qualified name as a string.
342342
"""
343343
return FullyQualifiedName(
344-
table=table_name,
344+
table=table_name, # type: ignore[arg-type]
345345
schema=schema_name,
346346
database=db_name,
347347
delimiter=delimiter,
@@ -647,7 +647,7 @@ def parse_full_table_name( # noqa: PLR6301
647647

648648
return db_name, schema_name, table_name
649649

650-
def table_exists(self, full_table_name: str) -> bool:
650+
def table_exists(self, full_table_name: str | FullyQualifiedName) -> bool:
651651
"""Determine if the target table already exists.
652652
653653
Args:
@@ -1067,7 +1067,7 @@ def _get_column_type(
10671067

10681068
def get_column_add_ddl(
10691069
self,
1070-
table_name: str,
1070+
table_name: str | FullyQualifiedName,
10711071
column_name: str,
10721072
column_type: sa.types.TypeEngine,
10731073
) -> sa.DDL:
@@ -1100,7 +1100,7 @@ def get_column_add_ddl(
11001100

11011101
@staticmethod
11021102
def get_column_rename_ddl(
1103-
table_name: str,
1103+
table_name: str | FullyQualifiedName,
11041104
column_name: str,
11051105
new_column_name: str,
11061106
) -> sa.DDL:
@@ -1128,7 +1128,7 @@ def get_column_rename_ddl(
11281128

11291129
@staticmethod
11301130
def get_column_alter_ddl(
1131-
table_name: str,
1131+
table_name: str | FullyQualifiedName,
11321132
column_name: str,
11331133
column_type: sa.types.TypeEngine,
11341134
) -> sa.DDL:

Diff for: singer_sdk/streams/sql.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from singer_sdk.streams.core import REPLICATION_INCREMENTAL, Stream
1515

1616
if t.TYPE_CHECKING:
17+
from singer_sdk.connectors.sql import FullyQualifiedName
1718
from singer_sdk.helpers.types import Context
1819
from singer_sdk.tap_base import Tap
1920

@@ -124,7 +125,7 @@ def primary_keys(self, new_value: t.Sequence[str]) -> None:
124125
self._singer_catalog_entry.metadata.root.table_key_properties = new_value
125126

126127
@property
127-
def fully_qualified_name(self) -> str:
128+
def fully_qualified_name(self) -> FullyQualifiedName:
128129
"""Generate the fully qualified version of the table name.
129130
130131
Raises:

0 commit comments

Comments
 (0)