Modified snowflake view def query (#14994)

This commit is contained in:
Onkar Ravgan 2024-02-02 14:34:43 +05:30 committed by GitHub
parent 0d001c31d3
commit 131e5f5767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,13 +120,10 @@ def get_view_definition( # pylint: disable=unused-argument
schema = schema or self.default_schema_name
if schema:
cursor = connection.execute(
"SHOW /* sqlalchemy:get_view_definition */ VIEWS "
f"LIKE '{view_name}' IN {schema}"
f"SELECT GET_DDL('VIEW','{schema}.{view_name}') AS \"text\""
)
else:
cursor = connection.execute(
"SHOW /* sqlalchemy:get_view_definition */ VIEWS " f"LIKE '{view_name}'"
)
cursor = connection.execute(f"SELECT GET_DDL('VIEW','{view_name}') AS \"text\"")
n2i = self.__class__._map_name_to_idx(cursor) # pylint: disable=protected-access
try:
ret = cursor.fetchone()