-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix deserialization for str unions #1239
Fix deserialization for str unions #1239
Commits on Oct 15, 2024
-
Fix deserialization for str unions
PR argoproj-labs#1168 changed the logic of map_runner_input and _parse to no longer pass incoming values to json.loads if their annotated type was a union that included str, rather than only when given a subtype of `Optional[str]`. Split `origin_type_issubclass` into two functions, `origin_type_issupertype` (which matches the previous behaviour) and `origin_type_issubtype`, and use the latter instead to restore the original behaviour. Add a runner check which verifies this behaviour. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52437be - Browse repository at this point
Copy the full SHA 52437beView commit details -
Skip union tests for Pydantic v1
parse_obj_as does not appear to support union types (it is converting ints to strings). Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 83eb2ee - Browse repository at this point
Copy the full SHA 83eb2eeView commit details
Commits on Oct 16, 2024
-
Document behaviour when given a tuple
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f0e1ddc - Browse repository at this point
Copy the full SHA f0e1ddcView commit details
Commits on Oct 17, 2024
-
Fix runtime error in origin_type_is*type functions
If origin_type_issubtype or origin_type_issupertype are passed a special form annotation, they will raise a TypeError due to passing it into issubclass. Fix this issue by first checking if the annotation is a type, and returning False if not. Unit test this with NoReturn, as we are very unlikely to ever create a special case for this type in the function. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 22d6bdc - Browse repository at this point
Copy the full SHA 22d6bdcView commit details -
The origin_type_is* functions were accidentally calling get_args on the original annotation rather than the unwrapped type. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c434384 - Browse repository at this point
Copy the full SHA c434384View commit details
Commits on Oct 21, 2024
-
Fix str-or-int-given-int for Pydantic v1
Pydantic v1 checks union types in declaration order, returning as soon as a coercion succeeds; see https://docs.pydantic.dev/1.10/usage/model_config/#smart-union for more. Change the test str_or_int_parameter signature from `str | int` to `int | str` to work with this legacy mode. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3782e8 - Browse repository at this point
Copy the full SHA f3782e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 925150b - Browse repository at this point
Copy the full SHA 925150bView commit details