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

ApiTypeError when some None values are returned. #16

Open
Armagetron opened this issue Nov 3, 2022 · 1 comment
Open

ApiTypeError when some None values are returned. #16

Armagetron opened this issue Nov 3, 2022 · 1 comment

Comments

@Armagetron
Copy link
Contributor

When querying some timestamps, it might happen, that the service returns some None values. The python client cannot handle them and returns the error

deutschland.smard.exceptions.ApiTypeError: Invalid type for variable '1'. Required value type is float and passed type was NoneType at ['received_data']['series'][87][1]

Can the model be updated to allow None values? I would rather have some None values in the response than an exception in this particular case.

@Armagetron
Copy link
Contributor Author

I figured out that you can do

configuration = smard.Configuration(
    discard_unknown_keys=True
)

However I still think this should be default.

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

No branches or pull requests

1 participant