Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 13, 2024
1 parent dbcd5e8 commit 46c9e1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FullyQualifiedName(UserString):
def __init__(
self,
*,
table: str | None = None,
table: str = "",
schema: str | None = None,
database: str | None = None,
delimiter: str = ".",
Expand Down Expand Up @@ -341,7 +341,7 @@ def get_fully_qualified_name(
The fully qualified name as a string.
"""
return FullyQualifiedName(
table=table_name,
table=table_name, # type: ignore[arg-type]
schema=schema_name,
database=db_name,
delimiter=delimiter,
Expand Down Expand Up @@ -647,7 +647,7 @@ def parse_full_table_name( # noqa: PLR6301

return db_name, schema_name, table_name

def table_exists(self, full_table_name: str) -> bool:
def table_exists(self, full_table_name: str | FullyQualifiedName) -> bool:
"""Determine if the target table already exists.
Args:
Expand Down Expand Up @@ -1067,7 +1067,7 @@ def _get_column_type(

def get_column_add_ddl(
self,
table_name: str,
table_name: str | FullyQualifiedName,
column_name: str,
column_type: sa.types.TypeEngine,
) -> sa.DDL:
Expand Down Expand Up @@ -1100,7 +1100,7 @@ def get_column_add_ddl(

@staticmethod
def get_column_rename_ddl(
table_name: str,
table_name: str | FullyQualifiedName,
column_name: str,
new_column_name: str,
) -> sa.DDL:
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def get_column_rename_ddl(

@staticmethod
def get_column_alter_ddl(
table_name: str,
table_name: str | FullyQualifiedName,
column_name: str,
column_type: sa.types.TypeEngine,
) -> sa.DDL:
Expand Down
3 changes: 2 additions & 1 deletion singer_sdk/streams/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from singer_sdk.streams.core import REPLICATION_INCREMENTAL, Stream

if t.TYPE_CHECKING:
from singer_sdk.connectors.sql import FullyQualifiedName
from singer_sdk.helpers.types import Context
from singer_sdk.tap_base import Tap

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

@property
def fully_qualified_name(self) -> str:
def fully_qualified_name(self) -> FullyQualifiedName:
"""Generate the fully qualified version of the table name.
Raises:
Expand Down

0 comments on commit 46c9e1a

Please sign in to comment.