1313import datetime
1414import json
1515import mimetypes
16- from multiprocessing .pool import ThreadPool
1716import os
1817import re
1918import tempfile
19+ from multiprocessing .pool import ThreadPool
20+ from urllib .parse import quote
2021
21- # python 2 and python 3 compatibility library
22- import six
23- from six .moves .urllib .parse import quote
24-
25- from influxdb_client .configuration import Configuration
2622import influxdb_client .domain
27- from influxdb_client ._async import rest
2823from influxdb_client import SigninService
2924from influxdb_client import SignoutService
25+ from influxdb_client ._async import rest
26+ from influxdb_client .configuration import Configuration
3027from influxdb_client .rest import _requires_create_user_session , _requires_expire_user_session
3128
3229
@@ -52,10 +49,10 @@ class ApiClientAsync(object):
5249 to the API. More threads means more concurrent API requests.
5350 """
5451
55- PRIMITIVE_TYPES = (float , bool , bytes , six . text_type ) + six . integer_types
52+ PRIMITIVE_TYPES = (float , bool , bytes , str , int )
5653 NATIVE_TYPES_MAPPING = {
5754 'int' : int ,
58- 'long' : int if six . PY3 else long , # noqa: F821
55+ 'long' : int ,
5956 'float' : float ,
6057 'str' : str ,
6158 'bool' : bool ,
@@ -231,11 +228,11 @@ def sanitize_for_serialization(self, obj):
231228 # Convert attribute name to json key in
232229 # model definition for request.
233230 obj_dict = {obj .attribute_map [attr ]: getattr (obj , attr )
234- for attr , _ in six . iteritems ( obj .openapi_types )
231+ for attr , _ in obj .openapi_types . items ( )
235232 if getattr (obj , attr ) is not None }
236233
237234 return {key : self .sanitize_for_serialization (val )
238- for key , val in six . iteritems ( obj_dict )}
235+ for key , val in obj_dict . items ( )}
239236
240237 def deserialize (self , response , response_type ):
241238 """Deserializes response into an object.
@@ -279,7 +276,7 @@ def __deserialize(self, data, klass):
279276 if klass .startswith ('dict(' ):
280277 sub_kls = re .match (r'dict\(([^,]*), (.*)\)' , klass ).group (2 )
281278 return {k : self .__deserialize (v , sub_kls )
282- for k , v in six . iteritems ( data )}
279+ for k , v in data . items ( )}
283280
284281 # convert str to class
285282 if klass in self .NATIVE_TYPES_MAPPING :
@@ -438,7 +435,7 @@ def parameters_to_tuples(self, params, collection_formats):
438435 new_params = []
439436 if collection_formats is None :
440437 collection_formats = {}
441- for k , v in six . iteritems ( params ) if isinstance (params , dict ) else params : # noqa: E501
438+ for k , v in params . items ( ) if isinstance (params , dict ) else params : # noqa: E501
442439 if k in collection_formats :
443440 collection_format = collection_formats [k ]
444441 if collection_format == 'multi' :
@@ -471,7 +468,7 @@ def prepare_post_parameters(self, post_params=None, files=None):
471468 params = post_params
472469
473470 if files :
474- for k , v in six . iteritems ( files ):
471+ for k , v in files . items ( ):
475472 if not v :
476473 continue
477474 file_names = v if type (v ) is list else [v ]
@@ -577,7 +574,7 @@ def __deserialize_primitive(self, data, klass):
577574 try :
578575 return klass (data )
579576 except UnicodeEncodeError :
580- return six . text_type (data )
577+ return str (data )
581578 except TypeError :
582579 return data
583580
@@ -640,7 +637,7 @@ def __deserialize_model(self, data, klass):
640637
641638 kwargs = {}
642639 if klass .openapi_types is not None :
643- for attr , attr_type in six . iteritems ( klass .openapi_types ):
640+ for attr , attr_type in klass .openapi_types . items ( ):
644641 if (data is not None and
645642 klass .attribute_map [attr ] in data and
646643 isinstance (data , (list , dict ))):
0 commit comments