@@ -22,10 +22,10 @@ def fetch(self, sql) -> Iterator[any]:
2222 raise NotImplementedError
2323
2424 @abstractmethod
25- def save_table (self , full_name : str , rows : list [any ], klass : type , mode : str = "append" ):
25+ def save_table (self , full_name : str , rows : list [any ], klass : dataclasses . dataclass , mode : str = "append" ):
2626 raise NotImplementedError
2727
28- def create_table (self , full_name : str , klass : type ):
28+ def create_table (self , full_name : str , klass : dataclasses . dataclass ):
2929 ddl = f"CREATE TABLE IF NOT EXISTS { full_name } ({ self ._schema_for (klass )} ) USING DELTA"
3030 self .execute (ddl )
3131
@@ -86,7 +86,7 @@ def fetch(self, sql) -> Iterator[any]:
8686 logger .debug (f"[api][fetch] { sql } " )
8787 return self ._sql .execute_fetch_all (self ._warehouse_id , sql )
8888
89- def save_table (self , full_name : str , rows : list [any ], klass : type , mode = "append" ):
89+ def save_table (self , full_name : str , rows : list [any ], klass : dataclasses . dataclass , mode = "append" ):
9090 if mode == "overwrite" :
9191 msg = "Overwrite mode is not yet supported"
9292 raise NotImplementedError (msg )
@@ -140,7 +140,7 @@ def fetch(self, sql) -> Iterator[any]:
140140 logger .debug (f"[spark][fetch] { sql } " )
141141 return self ._spark .sql (sql ).collect ()
142142
143- def save_table (self , full_name : str , rows : list [any ], klass : type , mode : str = "append" ):
143+ def save_table (self , full_name : str , rows : list [any ], klass : dataclasses . dataclass , mode : str = "append" ):
144144 rows = self ._filter_none_rows (rows , full_name )
145145
146146 if len (rows ) == 0 :
@@ -152,7 +152,7 @@ def save_table(self, full_name: str, rows: list[any], klass: type, mode: str = "
152152
153153
154154class CrawlerBase :
155- def __init__ (self , backend : SqlBackend , catalog : str , schema : str , table : str , klass : type ):
155+ def __init__ (self , backend : SqlBackend , catalog : str , schema : str , table : str , klass : dataclasses . dataclass ):
156156 """
157157 Initializes a CrawlerBase instance.
158158
0 commit comments