-
Notifications
You must be signed in to change notification settings - Fork 59
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
TypeError: Cannot coerce {'mandatory': True} into <class 'str'> #740
Comments
Okay, here the metadata dictionary is wrongly passed as the default value. |
Looks like the |
It does not look like the logic in Not sure what to make of this bug. Will adjust the offending test in Clinica meanwhile. |
I think this is just a case of type-checking uncovering an existing bug. I have run into the missing help_string -> 3rd arg == default issue before and it is pretty confusing. I reckon we should have a look at changing that behaviour if we end up making any changes to the API |
Supporting multiple triples whose content of the last attribute decides what it means, is a recipe for disaster imo. Since metadata is pretty much required to provide
Maybe? |
This snippet used to work with version 0.22:
But fails with version 0.23 with a coercion error:
TypeError: Cannot coerce {'mandatory': True} into <class 'str'> in 'T1w' field of Input as the coercion doesn't match any of the explicit inclusion criteria: Sequence -> Sequence, Mapping -> Mapping, Path -> PathLike, str -> PathLike, PathLike -> Path, PathLike -> str, Any -> MultiInputObj, int -> float, Integer -> float, int -> Decimal, Boolean -> bool, Decimal -> float, Integer -> int, Text -> str, bool -> Boolean, float -> Decimal, int -> Integer, str -> Text, integer -> int, floating -> float, bool_ -> bool, integer -> float, character -> str, complexfloating -> complex, bytes_ -> bytes, ndarray -> Sequence, Sequence -> ndarray
Suggesting that fields with metadata are incorrectly fed to the type coercion functionality.
The text was updated successfully, but these errors were encountered: