@@ -839,7 +839,7 @@ def get_object_names(
839
839
view_names = []
840
840
return [(t , False ) for t in table_names ] + [(v , True ) for v in view_names ]
841
841
842
- def discover_catalog_entry_sql_datatype ( # noqa: PLR6301
842
+ def _sa_type_to_str ( # noqa: PLR6301
843
843
self ,
844
844
data_type : sa .types .TypeEngine ,
845
845
) -> str :
@@ -908,6 +908,7 @@ def discover_catalog_entry(
908
908
909
909
# Initialize columns list
910
910
table_schema = th .PropertiesList ()
911
+ datatypes = {}
911
912
for column_def in inspected .get_columns (table_name , schema = schema_name ):
912
913
column_name = column_def ["name" ]
913
914
is_nullable = column_def .get ("nullable" , False )
@@ -920,13 +921,9 @@ def discover_catalog_entry(
920
921
required = column_name in key_properties if key_properties else False ,
921
922
),
922
923
)
923
- schema = table_schema . to_dict ( )
924
+ datatypes [ column_def [ "name" ]] = self . _sa_type_to_str ( column_def [ "type" ] )
924
925
925
- sql_datatypes = {}
926
- for column_def in inspected .get_columns (table_name , schema = schema_name ):
927
- sql_datatypes [str (column_def ["name" ])] = (
928
- self .discover_catalog_entry_sql_datatype (column_def ["type" ])
929
- )
926
+ schema = table_schema .to_dict ()
930
927
931
928
# Initialize available replication methods
932
929
addl_replication_methods : list [str ] = ["" ] # By default an empty list.
@@ -952,7 +949,7 @@ def discover_catalog_entry(
952
949
replication_method = replication_method ,
953
950
key_properties = key_properties ,
954
951
valid_replication_keys = None , # Must be defined by user
955
- sql_datatypes = sql_datatypes ,
952
+ sql_datatypes = datatypes ,
956
953
),
957
954
database = None , # Expects single-database context
958
955
row_count = None ,
0 commit comments