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

boundary spec hint the validation type #600

Merged
merged 1 commit into from
Dec 6, 2022
Merged

Conversation

JunchengXue
Copy link
Contributor

No description provided.

@tylerflex
Copy link
Collaborator

tylerflex commented Dec 7, 2022

I think the proper way to handle this (consistent with how we do it in other places) is to include

from .types import annotate_type

and then include it here

plus: BoundaryEdgeType = pd.Field(

See here

data: Tuple[annotate_type(MonitorDataType), ...] = pd.Field(

However, maybe we should instead wrap pd.Field to always include a discriminator="type" kwarg?

Another comment: the "type" string should not be hardcoded, instead it should be imported from types.py as TAG_TYPE_STR

TYPE_TAG_STR = "type"

In case it changes in the future.

@tylerflex
Copy link
Collaborator

Note: I made PR #605 to handle the TYPE_TAG_STR issue.
I tried annotate_type() and got obscure errors, will need to revisit this some other time.
Perhaps providing discriminator=TYPE_TAG_STR in all fields is the way forward. Made issue #604 to remind myself to look into it in the future.

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