Skip to content

Fix positional GROUP BY in expect_column_values_to_have_consistent_casing#46

Merged
GuruM merged 1 commit into
metaplane:mainfrom
sdebruyn:fix/consistent-casing-positional-group-by
May 17, 2026
Merged

Fix positional GROUP BY in expect_column_values_to_have_consistent_casing#46
GuruM merged 1 commit into
metaplane:mainfrom
sdebruyn:fix/consistent-casing-positional-group-by

Conversation

@sdebruyn
Copy link
Copy Markdown
Contributor

Summary

  • Replaces GROUP BY 1 with GROUP BY lower(distinct_values) in the expect_column_values_to_have_consistent_casing test macro
  • T-SQL (Microsoft Fabric, SQL Server, Azure SQL) does not support positional GROUP BY references
  • Explicit column expressions work on all SQL dialects

Fixes #44

Test plan

  • Run expect_column_values_to_have_consistent_casing with display_inconsistent_columns=True on a T-SQL adapter — should no longer error
  • Run the same test on PostgreSQL/Snowflake/BigQuery — should still pass
  • Test both display_inconsistent_columns=True and display_inconsistent_columns=False paths

Replace `GROUP BY 1` with `GROUP BY lower(distinct_values)`. T-SQL
dialects (Microsoft Fabric, SQL Server, Azure SQL) do not support
positional GROUP BY references.

Fixes metaplane#44
Copilot AI review requested due to automatic review settings May 17, 2026 11:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a cross-dialect compatibility issue in the expect_column_values_to_have_consistent_casing schema test by removing positional GROUP BY usage, which fails on T-SQL adapters (SQL Server / Azure SQL / Fabric).

Changes:

  • Replaces GROUP BY 1 with an explicit GROUP BY lower(distinct_values) in the display_inconsistent_columns=True query path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GuruM GuruM merged commit 991651f into metaplane:main May 17, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expect_column_values_to_have_consistent_casing uses positional GROUP BY

3 participants