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

Use nmdc-schema-provided function to extract typecode from id regex pattern #866

Closed
eecavanna opened this issue Jan 19, 2025 · 0 comments · Fixed by #878
Closed

Use nmdc-schema-provided function to extract typecode from id regex pattern #866

eecavanna opened this issue Jan 19, 2025 · 0 comments · Fixed by #878
Assignees
Labels
X SMALL Less than 1 day

Comments

@eecavanna
Copy link
Collaborator

Background

Currently, the Runtime has its own logic and code for extracting a typecode from an id regex pattern.

def extract_typecode_from_pattern(pattern: str) -> str:

In nmdc-schema version 11.3.0 (release notes), a function was introduced into the nmdc-schema package (i.e., in its nmdc_schema/id_helpers.py module) that can be used to do the same thing.

Task

The task here is to update the Runtime to import and use that function instead of maintaining its own independent copy, whose logic could drift from the "authoritative" logic in the nmdc-schema repo.

Footnote

Once the schema presents the typecode in its own schema element—as opposed to it being in a special spot in a regex pattern—we can stop using a regex pattern parsing function for this.

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