-
-
Notifications
You must be signed in to change notification settings - Fork 873
RF01: refine support for dialects with dot access syntax #6400
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
RF01: refine support for dialects with dot access syntax #6400
Conversation
Dot notation is incompatible with this check.
Coverage Results ✅
|
This feels like quite an extreme fix. I think there should be a better way of resolving this. In the original issue the table name is there:
It's just qualified more than once (although that's Redshift). With the Athena example, I think it would be enough to only flag issues with the rule if there's more than one table in the query - at which point we should already expect that the first identifier should be the table name. On interesting variant would be to just change the error message slightly, to indicate that if it's in Redshift or Athena - and it's a structured access type - we recommend having the table name as the first element. Thoughts? |
Alternatives which I was considering were to skip rule if query contains only one table reference (effectively assuming that columns are unqualified), or maybe skip rule if query contains one unaliased table reference. This effectively solves both athena and redshift but was not consistent with repository main. At the same time it's more fundamental rework - so let's get agreement that it's a valid direction before starting implementation. |
@alanmcruickshank it ended up being a fairly modest uplift. I am happy with the essence of the fix, test cases / docs possibly can be refined. |
I squeezed in for #6402 since it was somewhat close to touched code regions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Looks good I think 👍 .
Well done for fitting in that other relevant issue too.
Brief summary of the change made
new
orold
in SQLite trigger raise RF01 #6402Are there any other side effects of this change that we should be aware of?
No.
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 intest/fixtures/rules/std_rule_cases
..sql
/.yml
parser test cases intest/fixtures/dialects
(note YML files can be auto generated withtox -e generate-fixture-yml
).test/fixtures/linter/autofix
.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.