Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snowflake dialect update for MERGE INTO predicates #2670

Merged
merged 4 commits into from
Feb 16, 2022
Merged

Snowflake dialect update for MERGE INTO predicates #2670

merged 4 commits into from
Feb 16, 2022

Conversation

seve-martinez
Copy link
Contributor

@seve-martinez seve-martinez commented Feb 16, 2022

Fix for #2666
Updated the snowflake dialect file to handle AND within the WHEN NOT MATCHED clause.

Updated snowflake merge dialect test to include an example.

Brief summary of the change made

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

Pull Request checklist

  • [x ] 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.

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

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

Looks great!

Normally would suggest not including other unrelated changes like the bench one, but I agree with your change so let's just include it.

I've had two small suggestions on the other changes.

src/sqlfluff/dialects/dialect_snowflake.py Outdated Show resolved Hide resolved
test/fixtures/dialects/snowflake/snowflake_merge_into.sql Outdated Show resolved Hide resolved
seve-martinez and others added 2 commits February 16, 2022 12:19
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
@seve-martinez
Copy link
Contributor Author

Thank you for the highlights! Updated with your recommended changes.

@tunetheweb
Copy link
Member

Thank you for the highlights! Updated with your recommended changes.

You'll need to regenerate the YAMLs for my second suggestion. After that think we're good to merge.

@codecov
Copy link

codecov bot commented Feb 16, 2022

Codecov Report

Merging #2670 (f64db20) into main (fce82db) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2670   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        12019     12019           
=========================================
  Hits         12019     12019           
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_snowflake.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fce82db...f64db20. Read the comment docs.

@tunetheweb tunetheweb changed the title snowflake dialect update for merge predicates Snowflake dialect update for MERGE INTO predicates Feb 16, 2022
@tunetheweb tunetheweb merged commit b89f0d9 into sqlfluff:main Feb 16, 2022
@tunetheweb
Copy link
Member

Thanks! Hopefully will have given you the bug to add more PRs 😁

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.

2 participants