Skip to content

fix: handle duplicate audit names#5431

Merged
toriwei merged 7 commits intomainfrom
tori/fix-duplicate-audits
Sep 26, 2025
Merged

fix: handle duplicate audit names#5431
toriwei merged 7 commits intomainfrom
tori/fix-duplicate-audits

Conversation

@toriwei
Copy link
Contributor

@toriwei toriwei commented Sep 23, 2025

create unique canonical_name to prevent duplicate audit names

@erindru
Copy link
Collaborator

erindru commented Sep 23, 2025

Can you please add a test that exercises this change?


audit: Audit
if self.package_name != context.project_name:
self.name = f"{self.package_name}.{self.name}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This subtly mutates self.name and makes it different before / after calling to_sqlmesh().

Have you considered using a local variable for this instead and passing it for the name= parameter in the StandaloneAudit/ModelAudit constructors?

@toriwei toriwei force-pushed the tori/fix-duplicate-audits branch from cb7ff1a to eb01334 Compare September 23, 2025 23:30
@toriwei toriwei marked this pull request as ready for review September 24, 2025 17:41
@toriwei toriwei force-pushed the tori/fix-duplicate-audits branch from d6d3c7c to e3c713c Compare September 24, 2025 17:52
@toriwei toriwei force-pushed the tori/fix-duplicate-audits branch from d6a4917 to 64d2a37 Compare September 26, 2025 15:52
@toriwei toriwei merged commit 71f3eb7 into main Sep 26, 2025
35 of 36 checks passed
@toriwei toriwei deleted the tori/fix-duplicate-audits branch September 26, 2025 16:16
toriwei added a commit that referenced this pull request Sep 26, 2025
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.

3 participants