-
Notifications
You must be signed in to change notification settings - Fork 31
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
Dtype numpy #316
Dtype numpy #316
Conversation
5012385
to
94c7801
Compare
Despite the fact pydantic will fail correctly for the list field here: event-model/event_model/tests/test_auth.py Lines 78 to 88 in 94c7801
The schema will not, it's because for some reason pydantic is outputting
|
Inserting {
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "string"
},
{
"description": "A numpy dtype e.g `<U9`, `<f16`",
"pattern": "[|<>][tbiufcmMOSUV][0-9]+",
"type": "string"
}
],
"items": false,
"type": "array"
},
"type": "array" |
For now we'll get around this by adding _ConstrainedDtypeNpStructure = Annotated[
Tuple[str, _ConstrainedDtype], Field(json_schema_extra={"items": False})
] But I'll make an issue on pydantic. |
Okay I figured it out, we simply can't pass a tuple into the jsonschema... While it will do positional args differently, it requires the |
@tacaswell implemented this to allow for tuples, but it isn't working in this case |
Upgraded the validator and all worked as it should. |
aec192a
to
0e3a785
Compare
0e3a785
to
8d2d238
Compare
8d2d238
to
46834f0
Compare
fixes #308 |
Replacing #315