-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Description
the __deserialize_date function behaves differently depending on which dependencies you have installed at runtime.
https://github.com/kubernetes-client/python/blob/master/kubernetes/client/api_client.py#L585
if dateutils is installed you get datetime objects for dates and if not you get strings.
This is very bad behaviour for a library as code will break depending on which other packages are currently installed.
The function should be changed to always return a single type regardless of current runtime environment.
One way to do that would be to make the dependency mandatory and throw an import error on library load or to remove the dependency by parsing the string with stdlib methods.
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.