diff --git a/docs/metaflow/publish.md b/docs/metaflow/publish.md index da73f7d..b5f044e 100644 --- a/docs/metaflow/publish.md +++ b/docs/metaflow/publish.md @@ -106,3 +106,6 @@ Notes: - Invalid `status`/`sla` values raise `ValueError` before any data is written. - Tagged tables surface in the `TABLE_OWNERSHIP_REGISTRY` view (see [Table-ownership registry view](table_ownership_registry.md)). +- The underlying Snowflake session always has `QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE` + set (`snowflake_connection.py`), so quoted identifiers in `query`/`audits` resolve + case-insensitively. diff --git a/docs/metaflow/publish_pandas.md b/docs/metaflow/publish_pandas.md index b9d5f51..869d0f3 100644 --- a/docs/metaflow/publish_pandas.md +++ b/docs/metaflow/publish_pandas.md @@ -80,6 +80,12 @@ publish_pandas( until then tagging is **skipped with a warning** and the publish still succeeds. - Invalid `status`/`sla` values raise `ValueError` before any data is written. +## Notes + +- The underlying Snowflake session always has `QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE` + set (`snowflake_connection.py`), so quoted identifiers resolve case-insensitively + regardless of `quote_identifiers`. + ## Limitations - When `use_s3_stage=True`, some column data types may not map exactly as expected between pandas/parquet and Snowflake. diff --git a/docs/metaflow/query_pandas_from_snowflake.md b/docs/metaflow/query_pandas_from_snowflake.md index df1210f..8b1c341 100644 --- a/docs/metaflow/query_pandas_from_snowflake.md +++ b/docs/metaflow/query_pandas_from_snowflake.md @@ -35,6 +35,12 @@ query_pandas_from_snowflake( **Returns:** `pd.DataFrame` query results with lowercase column names. +## Notes + +- The underlying Snowflake session always has `QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE` + set (`snowflake_connection.py`), so quoted identifiers in `query` resolve + case-insensitively. + ## Limitations - `use_s3_stage` does not support Snowflake `TIMESTAMP_TZ` and `TIMESTAMP_LTZ` data types. diff --git a/pyproject.toml b/pyproject.toml index b2d50ec..8a865fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ds-platform-utils" -version = "0.5.0" +version = "0.5.1" description = "Utility library for Pattern Data Science." readme = "README.md" authors = [ diff --git a/src/ds_platform_utils/metaflow/snowflake_connection.py b/src/ds_platform_utils/metaflow/snowflake_connection.py index e9828a5..fab22f0 100644 --- a/src/ds_platform_utils/metaflow/snowflake_connection.py +++ b/src/ds_platform_utils/metaflow/snowflake_connection.py @@ -88,6 +88,7 @@ def _create_snowflake_connection( # so we have to execute a raw query to set it. try: conn.execute_string("USE WAREHOUSE {}".format(warehouse)) + conn.execute_string("ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE") except Exception as e: raise RuntimeError(f"Failed to set Snowflake warehouse to {warehouse}: {e}") from e diff --git a/uv.lock b/uv.lock index 37078e2..daeb61b 100644 --- a/uv.lock +++ b/uv.lock @@ -479,7 +479,7 @@ wheels = [ [[package]] name = "ds-platform-utils" -version = "0.5.0" +version = "0.5.1" source = { editable = "." } dependencies = [ { name = "jinja2" },