-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
ignore functions with more than one element ... #3792
ignore functions with more than one element ... #3792
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3792 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 179 179
Lines 13727 13729 +2
=========================================
+ Hits 13727 13729 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
src/sqlfluff/rules/L010.py
Outdated
# If the parent element is a function_name and there is more than one element | ||
# below it, we ignore it because it is most likely a user defined function. | ||
# SUM() should be modified. However, dbo.myScalar() must not be modified. |
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.
I found this difficult to follow. Would it be easier to just say something like this:
# If the parent element is a function_name and there is more than one element | |
# below it, we ignore it because it is most likely a user defined function. | |
# SUM() should be modified. However, dbo.myScalar() must not be modified. | |
# Used by L030 (that inherits from this rule) | |
# If it's a qualified function_name (i.e with more than one part to | |
# function_name). Then it is likely an existing user defined function (UDF) | |
# which are case sensitive so ignore for this. |
I wonder should there be a include_qualified_functions
option in this (defaulted to false
)?
Also, I think in some SQL dialects there might be a SYS
schema or such like that contains the system functions, which are case insensitive? Then again not sure if there's a good reason to use that, so maybe fine to ignore that edge case.
Co-authored-by: Barry Pollard <barrypollard@google.com>
Co-authored-by: Barry Pollard <barrypollard@google.com>
Co-authored-by: Barry Pollard <barrypollard@google.com>
@tunetheweb: Could you take another look at this since you'd requested changes on it? |
Brief summary of the change made
fixes #3583
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 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.