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

L057: In BigQuery, allow hyphens by default #3645

Conversation

barrywhart
Copy link
Member

@barrywhart barrywhart commented Jul 20, 2022

Brief summary of the change made

Fixes #3638

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 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.

@barrywhart barrywhart marked this pull request as draft July 20, 2022 20:49
@@ -174,7 +174,7 @@ group_by_and_order_by_style = consistent
unquoted_identifiers_policy = all
quoted_identifiers_policy = all
allow_space_in_identifier = False
additional_allowed_characters = ""
additional_allowed_characters = None
Copy link
Member Author

Choose a reason for hiding this comment

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

Minor bug fix: With Python configparser.ConfigParser, the class used to read this file, empty quotes don't return an empty string. They literally return the string "", which I believe is not what we want -- i.e., we don't want to allow " in names.

@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #3645 (3e736ed) into main (2c59a93) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #3645   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          175       175           
  Lines        13286     13294    +8     
=========================================
+ Hits         13286     13294    +8     
Impacted Files Coverage Δ
src/sqlfluff/rules/L057.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 2c59a93...3e736ed. Read the comment docs.

@barrywhart barrywhart marked this pull request as ready for review July 20, 2022 21:18
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.

Wonder if we should have a test without quotes?

@barrywhart
Copy link
Member Author

I added another test case, test_pass_hyphen_bigquery_no_quotes, as you suggested. This was already "working" by accident, as we discussed on the related issue, so it's not related to the changes in this PR, but I agree it seems like a good test to prevent future breakage.

@barrywhart barrywhart merged commit ac852a2 into sqlfluff:main Jul 20, 2022
@barrywhart barrywhart deleted the bhart-issue_3638_l057_bigquery_allow_hyphens branch July 20, 2022 23:02
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