Snowflake Make Query tag Optional (#6114)

* Snowflake make query tag optional

* Modified Description
This commit is contained in:
Mayur Singal 2022-07-18 23:59:27 +05:30 committed by GitHub
parent 7b6332edef
commit da559150c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -65,9 +65,8 @@
},
"queryTag": {
"title": "Query Tag",
"description": "Session query tag used to monitor usage on snoflake",
"type": "string",
"default": "OpenMetadata"
"description": "Session query tag used to monitor usage on snoflake. To use a query tag snowflake user should have enough privileges to alter the session.",
"type": "string"
},
"privateKey": {
"title": "Private Key",

View File

@ -135,11 +135,12 @@ class SnowflakeSource(CommonDbSourceService):
"""
Method to set query tag for current session
"""
self.engine.execute(
SNOWFLAKE_SESSION_TAG_QUERY.format(
query_tag=self.service_connection.queryTag
if self.service_connection.queryTag:
self.engine.execute(
SNOWFLAKE_SESSION_TAG_QUERY.format(
query_tag=self.service_connection.queryTag
)
)
)
def get_database_names(self) -> Iterable[str]:
configured_db = self.config.serviceConnection.__root__.config.database