0

I’ve noticed that my Snowflake expectations only work when the column parameter is written in lowercase (even if the original column is in uppercase):

"expectations": [
    {
        "expectation_type": "expect_column_values_to_be_unique",
        "kwargs": {
            "column": "email"
        }
    }
]

But when column is written as EMAIL I get the following error:

great_expectations.exceptions.exceptions.MetricResolutionError: Error: The column "EMAIL" in BatchData does not exist.

My Data Context config looks like this:

{
  "datasources": {
    "my_datasource": {
      "class_name": "Datasource",
      "module_name": "great_expectations.datasource",
      "execution_engine": {
        "class_name": "SqlAlchemyExecutionEngine",
        "connection_string": "snowflake://..."
      },
      "data_connectors": {
        "configured_asset_data_connector": {
          "class_name": "ConfiguredAssetSqlDataConnector",
          "assets": {
            "my_table_asset": {
              "table_name": "SOME_TABLE",
              "schema_name": "PUBLIC"
            }
          }
        }
      }
    }
  },
  "stores": {...}
}

According to this Pull Request, it’s possible to set the flag use_quoted_name to True in order to preserve case in table/column names but I couldn’t find any docs where to set this configuration. I'm using Great Expectations 0.15.41.

Does anybody know where to set this property?

Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96
  • A quick search shows it how to set it [here](https://github.com/great-expectations/great_expectations/blob/20c98f569b3eb97dbc9741d545b9f348b66ccb3f/docs_rtd/guides/how_to_guides/creating_batches/how_to_load_a_database_table_view_or_query_result_as_a_batch.rst) – Sergiu Jan 01 '23 at 21:09
  • Hi @Sergiu, I found the same searching across the repo but it can't get where to set it in my datasource description – Joaquín L. Robles Jan 03 '23 at 20:53

1 Answers1

0

This is now solved with PR #6951 without the need to set use_quoted_name

Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96