Skip to content

Conversation

shervinmathieu
Copy link
Contributor

@shervinmathieu shervinmathieu commented Feb 25, 2025

Brief summary of the change made

fixes #6683

Allows RF02 to ignore anonymous parameters for Snowflake lambda expressions used in functions transform, filter, reduce.
Dialect parsing implementation for lambdas in Snowflake was different than for trino and duckdb.
Made changes to snowflake tokens to match trino and duckdb implementation, this allows for minimal change in rule checking.
With the modified tokens, simply adding snowflake to the list of dialects that support lambda expressions in analysis/select.py fixes RF02 to no longer trigger incorrectly.

Are there any other side effects of this change that we should be aware of?

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@shervinmathieu
Copy link
Contributor Author

While I made this PR to specifically fix RF02, it should also fix RF03 as a side effect.

@shervinmathieu shervinmathieu force-pushed the snowflake_lambda_rf02 branch from 5a092af to 13711e2 Compare March 6, 2025 19:33
@shervinmathieu
Copy link
Contributor Author

Fixed the yml testing files and added a test for rule RF03.

Copy link
Contributor

@WittierDinosaur WittierDinosaur left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

github-actions bot commented Mar 30, 2025

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   19567      0   100%

249 files skipped due to complete coverage.

auto-merge was automatically disabled April 1, 2025 12:43

Head branch was pushed to by a user without write access

@shervinmathieu shervinmathieu force-pushed the snowflake_lambda_rf02 branch from 40f63aa to 4464b4e Compare April 1, 2025 12:44
@keraion keraion added this pull request to the merge queue Apr 4, 2025
Merged via the queue into sqlfluff:main with commit e39f855 Apr 4, 2025
28 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.

Snowflake lambda expression trigger RF02 & RF03
3 participants