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

PyaroConfig from pyaerocom.io.pyaro.pyaro_config is too pedantic #1399

Closed
jgriesfeller opened this issue Nov 11, 2024 · 0 comments · Fixed by #1400
Closed

PyaroConfig from pyaerocom.io.pyaro.pyaro_config is too pedantic #1399

jgriesfeller opened this issue Nov 11, 2024 · 0 comments · Fixed by #1400
Assignees
Milestone

Comments

@jgriesfeller
Copy link
Member

Is your feature request related to a problem? Please describe.
PyaroConfig from pyaerocom.io.pyaro.pyaro_config is too pedantic.
Example config:

obsconfig = PyaroConfig(
            name=data_name,
            data_id=data_id,
            filename_or_obj_or_url=url,
            filters=station_filter,)

filename_or_obj_or_url can only be a string but not list of strings. It should also allow a list of strings and maybe also a list of path like objects (both!; not only path like objects since there are pyaro readers that use this differently)

Describe the solution you would like to see
allow a list of strings and a list of path like objects in addition

Additional context
This error comes up when supplying a list:

E       pydantic_core._pydantic_core.ValidationError: 1 validation error for PyaroConfig
E       filename_or_obj_or_url
E         Input should be a valid string [type=string_type, input_value=['concso4t', 'concso4c'], input_type=list]
E           For further information visit https://errors.pydantic.dev/2.9/v/string_type

test_PyerocomBinding.py:91: ValidationError
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 a pull request may close this issue.

1 participant