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

TSQL: Remove match possibilities for segments with no TSQL equivalent #1416

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

jpers36
Copy link
Contributor

@jpers36 jpers36 commented Sep 16, 2021

Brief summary of the change made

Remapping segments to Nothing() that have no TSQL equivalent. This will keep the linter from pursing paths that include TSQL non-keywords and failing with the runtime error "Grammar refers to 'KeywordSegment' which was not found in the tsql dialect".

@jpers36
Copy link
Contributor Author

jpers36 commented Sep 16, 2021

Something unusual is going on with UnorderedSelectStatementSegment. It's failing to match on the create_view_with_cte.sql tsql test case when LimitClauseSegment and NamedWindowSegment are redefined to Nothing(), even though neither of those segments actually exists in the test case. Removing those redefines for now, since this is meant to be a simple first PR.

@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #1416 (5ea371c) into main (5c2491a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #1416   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          127       127           
  Lines         8583      8603   +20     
=========================================
+ Hits          8583      8603   +20     
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_tsql.py 100.00% <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 5c2491a...5ea371c. Read the comment docs.

@tunetheweb tunetheweb merged commit 7e1b483 into sqlfluff:main Sep 16, 2021
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.

None yet

2 participants