if hasattr(sqltypes, "Uuid") and isinstance(sql_t, sqltypes.Uuid):
# we represent UUID as text by default, see default_table_adapter
col["data_type"] = "text"
if isinstance(sql_t, sqltypes.Numeric):
# check for Numeric type first and integer later, some numeric types (ie. Oracle)
# derive from both
# all Numeric types that are returned as floats will assume "double" type
# and returned as decimals will assume "decimal" type
if sql_t.asdecimal is False:
col["data_type"] = "double"
After
if hasattr(sqltypes, "Uuid") and isinstance(sql_t, sqltypes.Uuid):
# we represent UUID as text by default, see default_table_adapter
col["data_type"] = "text"
elif isinstance(sql_t, sqltypes.Numeric):
# check for Numeric type first and integer later, some numeric types (ie. Oracle)
# derive from both
# all Numeric types that are returned as floats will assume "double" type
# and returned as decimals will assume "decimal" type
if sql_t.asdecimal is False:
col["data_type"] = "double"
dlt version
1.0.0
Describe the problem
Exactly what the title says.
Expected behavior
No annoying warnings log messages.
Steps to reproduce
Operating system
Linux
Runtime environment
Local
Python version
3.11
dlt data source
built-in sql_database
dlt destination
Google BigQuery
Other deployment details
No response
Additional information
The bug can be easily corrected by changing https://github.com/dlt-hub/dlt/blob/devel/dlt/sources/sql_database/schema_types.py#L89
Before
After