From 78d150316062f8148b5d2a78d8e8720039652ec4 Mon Sep 17 00:00:00 2001 From: Anthony Burdi Date: Tue, 10 Oct 2023 16:57:18 -0400 Subject: [PATCH] [BUGFIX] Column Descriptive Metrics: Convert table name to lowercase for snowflake (#8817) --- great_expectations/expectations/metrics/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/great_expectations/expectations/metrics/util.py b/great_expectations/expectations/metrics/util.py index 70a784d384ee..0c578af7e7cd 100644 --- a/great_expectations/expectations/metrics/util.py +++ b/great_expectations/expectations/metrics/util.py @@ -394,10 +394,12 @@ def get_sqlalchemy_column_metadata( # We must explicitly create a subquery columns = table_selectable.columns().subquery().columns else: + # TODO: remove cast to a string once [this](https://github.com/snowflakedb/snowflake-sqlalchemy/issues/157) issue is resovled + table_name = str(table_selectable) + if execution_engine.dialect_name == GXSqlDialect.SNOWFLAKE: + table_name = table_name.lower() columns = inspector.get_columns( - str( - table_selectable - ), # TODO: remove cast to a string once [this](https://github.com/snowflakedb/snowflake-sqlalchemy/issues/157) issue is resovled + table_name=table_name, schema=schema_name, ) except (