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

Update valid name regex to disallow dunders #150

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

QMalcolm
Copy link
Collaborator

Resolves #149

Description

We use dunders __ to separate named objects in a single string reference. I.e. orders__is_large_order where order is the primary entity and is_large_order is the dimension name. If people use dunders in their names, then this logic breaks. This PR updates the regex for name validity checking to disallow dunders.

Checklist

@QMalcolm QMalcolm added the bug Something isn't working label Sep 14, 2023
@QMalcolm QMalcolm requested a review from tlento September 14, 2023 20:51
@cla-bot cla-bot bot added the cla:yes label Sep 14, 2023
@QMalcolm QMalcolm added Backport 0.2.latest Fix should be backported to 0.2.latest and removed Backport 0.2.latest Fix should be backported to 0.2.latest labels Sep 14, 2023
Copy link
Collaborator

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Do we want this new rule to apply to semantic model names? I think we do. But that may cause some breakage for things which work today.

dbt_semantic_interfaces/validations/unique_valid_name.py Outdated Show resolved Hide resolved
@QMalcolm QMalcolm force-pushed the qmalcolm--149-disallow-dunders-in-names branch from 5580474 to 877afd4 Compare September 15, 2023 20:30
@QMalcolm QMalcolm merged commit a71ba0e into main Sep 15, 2023
9 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--149-disallow-dunders-in-names branch September 15, 2023 20:47
QMalcolm added a commit that referenced this pull request Sep 18, 2023
…unders-in-object-names

[BACKPORT 0.2.latest] Disallow dunders in object names (#150)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] UniqueAndValidNameRule allows DUNDER inside of element names
2 participants