Update snowflake.py (#1803)

* Update snowflake.py

* snowflake needs database and warehouse
This commit is contained in:
Ayush Shah 2021-12-17 00:16:49 +05:30 committed by GitHub
parent f4c3947fc5
commit d71c75aaa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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": {

View File

@ -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()

View File

@ -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