Skip to content

Update regex to match default labels#284

Merged
m-goggins merged 2 commits into
mainfrom
bug-fix-regex-pattern-for-algorithm-label
Apr 9, 2025
Merged

Update regex to match default labels#284
m-goggins merged 2 commits into
mainfrom
bug-fix-regex-pattern-for-algorithm-label

Conversation

@m-goggins

@m-goggins m-goggins commented Apr 9, 2025

Copy link
Copy Markdown
Collaborator

Description

We set the default algorithm labels to be BLOCK_feature1_feature2_MATCH_feature3_feature4 but the regex we included in the pydantic field validator did not allow for uppercase letters or underscores. This resulted in a 500 error when trying to retrieve the algorithms. The updated regex is a little more flexible and matches our default value pattern.

    | pydantic_core._pydantic_core.ValidationError: 2 validation errors for AlgorithmSummary
    | passes.0.label
    |   String should match pattern '^[a-z0-9]+(?:-[a-z0-9]+)*$' [type=string_pattern_mismatch, input_value='BLOCK_birthdate_identifi...CH_first_name_last_name', input_type=str]
    |     For further information visit https://errors.pydantic.dev/2.11/v/string_pattern_mismatch
    | passes.1.label
    |   String should match pattern '^[a-z0-9]+(?:-[a-z0-9]+)*$' [type=string_pattern_mismatch, input_value='BLOCK_zip_first_name_las...MATCH_address_birthdate', input_type=str]
    |     For further information visit https://errors.pydantic.dev/2.11/v/string_pattern_mismatch

Related Issues

Additional Notes

@codecov

codecov Bot commented Apr 9, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.80%. Comparing base (ec13f4f) to head (63b18bc).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #284      +/-   ##
==========================================
- Coverage   97.94%   97.80%   -0.15%     
==========================================
  Files          33       32       -1     
  Lines        1804     1774      -30     
==========================================
- Hits         1767     1735      -32     
- Misses         37       39       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m-goggins m-goggins marked this pull request as ready for review April 9, 2025 17:36
@ericbuckley

Copy link
Copy Markdown
Collaborator

@m-goggins oh great catch, thanks for fixing!

@m-goggins m-goggins merged commit 3ee7ec5 into main Apr 9, 2025
@m-goggins m-goggins deleted the bug-fix-regex-pattern-for-algorithm-label branch April 9, 2025 18:22
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.

2 participants