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

make dateutil mandatory for api client #1084

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import re
import tempfile
import dateutil.parser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is auto-generated by openapi-generator. Therefore this change won't persist when we re-generate the client.

This change has been made upstream OpenAPITools/openapi-generator#4316 v4.2.1. The change will be picked up when we upgrade to use the newer version (currently we are at v3.3.4)


# python 2 and python 3 compatibility library
import six
Expand Down Expand Up @@ -582,10 +583,7 @@ def __deserialize_date(self, string):
:return: date.
"""
try:
from dateutil.parser import parse
return parse(string).date()
except ImportError:
return string
return dateutil.parser.parse(string).date()
except ValueError:
raise rest.ApiException(
status=0,
Expand All @@ -601,10 +599,7 @@ def __deserialize_datatime(self, string):
:return: datetime.
"""
try:
from dateutil.parser import parse
return parse(string)
except ImportError:
return string
return dateutil.parser.parse(string)
except ValueError:
raise rest.ApiException(
status=0,
Expand Down