Skip to content

Metric name validation does not match server #863

Description

@wk9874

Description of Bug

Trying to create metrics from RemKiT variables gives errors like:

[1, 'e-i_odd_C1Il+2_h=2Ion', '[key]']              │ str != string_pattern_mismatch │ String should match pattern '^[a-zA-Z0-9\\-\\_\\s\\/\\.:=><]+$'

Checked with Andrew, the server validation is:
^[a-zA-Z0-9\-\_\s\/\.:=><+\(\)]+$
Whereas in the Python API it is:
METRIC_KEY_REGEX: str = r"^[a-zA-Z0-9\-\_\s\/\.:=><]+$"
Need to change this to match the server version

Steps To Reproduce

Steps to reproduce the behavior:

  1. Try to create a metric with a '+' in the name

Expected behavior

Name should be accepted

Actual Behaviour

Name is rejected due to failing validation

Setup

  • OS: Ubuntu
  • Python version: 3.11

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions