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

Object Literals #3620

Merged
merged 21 commits into from Jul 17, 2022
Merged

Object Literals #3620

merged 21 commits into from Jul 17, 2022

Conversation

alanmcruickshank
Copy link
Member

This resolves #3606 .

Quite a few other things going on here though. The way that literals and expressions were being referenced wasn't very DRY, with many dialects redefining LiteralGrammar. In resolving some of those dependencies we also needed a better way of identifying offending grammars during debugging - so I've added a crumbs keyword to simple, which catches infinite recursion early and outputs the offending loop. The magic for that is in Ref.

Otherwise this is mostly the knockon effects of updating LiteralGrammar to include objects and then deduping elsewhere.

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.

LGTM if you can fix the failing test cases

@barrywhart
Copy link
Member

Some of the test failures are complaining about rule 48. Not sure why:

Message: '[L048] No config_keywords defined for L048'
Rule_L048' object has no attribute 'config_keywords'

@alanmcruickshank alanmcruickshank mentioned this pull request Jul 16, 2022
@codecov
Copy link

codecov bot commented Jul 17, 2022

Codecov Report

Merging #3620 (4824584) into main (d83ab36) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #3620   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          175       175           
  Lines        13255     13261    +6     
=========================================
+ Hits         13255     13261    +6     
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_athena.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_hive.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_postgres.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_snowflake.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_tsql.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_ansi.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 d83ab36...4824584. Read the comment docs.

@alanmcruickshank alanmcruickshank merged commit 6b31de4 into main Jul 17, 2022
@alanmcruickshank alanmcruickshank deleted the ac/object_literals branch July 17, 2022 10:09
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.

SQLFluff can't parse object literals in Snowflake
3 participants