Skip to content

Conversation

@theyostalservice
Copy link
Contributor

@theyostalservice theyostalservice commented Nov 8, 2025

Problem

Problems:

  1. The validation for metric names should not allow hyphens. They are already disallowed in dbt-semantic-interfaces and metricflow, and the error message here correctly identifies that they're not allowed, but a mistake in the regex allows them to slip through.
  2. These name errors are validation errors, not parsing errors, and should be treated as such.
  3. We don't have any tests showing that these work and protecting them during maintenance.

Solution

Fix the regex, change the error type that we raise, and add tests!

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Nov 8, 2025
Copy link
Contributor Author

theyostalservice commented Nov 8, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.93%. Comparing base (11ada88) to head (77e1c7d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12158      +/-   ##
==========================================
- Coverage   91.99%   91.93%   -0.06%     
==========================================
  Files         203      203              
  Lines       24847    24847              
==========================================
- Hits        22857    22843      -14     
- Misses       1990     2004      +14     
Flag Coverage Δ
integration 88.81% <100.00%> (-0.13%) ⬇️
unit 65.20% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 65.20% <100.00%> (+0.02%) ⬆️
Integration Tests 88.81% <100.00%> (-0.13%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theyostalservice theyostalservice force-pushed the patricky/fix-metric-name-validation-and-add-tests branch from a3a50af to ef95e92 Compare November 8, 2025 00:10
@theyostalservice theyostalservice marked this pull request as ready for review November 8, 2025 00:25
@theyostalservice theyostalservice requested a review from a team as a code owner November 8, 2025 00:25
@github-actions github-actions bot added the community This PR is from a community member label Nov 8, 2025
Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

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

@theyostalservice is my understanding correct that these were raising an error previously on the MetricFlow side, but just not in core? I ask because if so, this should be good as is. If no error was being raised anywhere then we'd have to do some additional handling in code as it'd be a breaking change

Copy link
Contributor Author

Yes, that's the correct understanding! :-)

@theyostalservice theyostalservice force-pushed the patricky/fix-metric-name-validation-and-add-tests branch from ef95e92 to 77e1c7d Compare November 10, 2025 23:51
@QMalcolm QMalcolm merged commit 5dd5166 into main Nov 11, 2025
58 of 59 checks passed
@QMalcolm QMalcolm deleted the patricky/fix-metric-name-validation-and-add-tests branch November 11, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes community This PR is from a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants