mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 04:26:57 +00:00
Update snowflake.py (#1803)
* Update snowflake.py * snowflake needs database and warehouse
This commit is contained in:
parent
f4c3947fc5
commit
d71c75aaa1
@ -2,11 +2,11 @@
|
||||
"source": {
|
||||
"type": "snowflake",
|
||||
"config": {
|
||||
|
||||
"host_port": "account.region.service.snowflakecomputing.com",
|
||||
"username": "username",
|
||||
"password": "strong_password",
|
||||
"database": "SNOWFLAKE_SAMPLE_DATA",
|
||||
"warehouse": "warehouse_name",
|
||||
"account": "account_name",
|
||||
"service_name": "snowflake",
|
||||
"table_filter_pattern": {
|
||||
|
||||
@ -25,12 +25,11 @@ register_custom_type(custom_types.TIMESTAMP_NTZ, "TIME")
|
||||
class SnowflakeConfig(SQLConnectionConfig):
|
||||
scheme = "snowflake"
|
||||
account: str
|
||||
database: Optional[str]
|
||||
warehouse: Optional[str]
|
||||
database: str
|
||||
warehouse: str
|
||||
role: Optional[str]
|
||||
duration: Optional[int]
|
||||
service_type = "Snowflake"
|
||||
connect_args: Optional[dict]
|
||||
|
||||
def get_connection_url(self):
|
||||
connect_string = super().get_connection_url()
|
||||
|
||||
@ -530,8 +530,9 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
|
||||
)
|
||||
if col_type == "NULL":
|
||||
col_type = "VARCHAR"
|
||||
data_type_display = "varchar"
|
||||
logger.warning(
|
||||
f"Unknown type mapped to VARCHAR: {column['name']}"
|
||||
f"Unknown type {column['type']} mapped to VARCHAR: {column['name']}"
|
||||
)
|
||||
om_column = Column(
|
||||
name=column["name"],
|
||||
@ -549,7 +550,7 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
|
||||
except Exception as err:
|
||||
logger.error(traceback.format_exc())
|
||||
logger.error(traceback.print_exc())
|
||||
logger.error(err)
|
||||
logger.error(f"{err} : {column}")
|
||||
continue
|
||||
table_columns.append(om_column)
|
||||
row_order = row_order + 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user