@@ -124,11 +124,11 @@ def serialize_array(key, array, formatting="indexed"):
124
124
serializable_types = (str , int , float , bool , datetime .date , APIHelper .CustomDate )
125
125
126
126
if isinstance (array [0 ], serializable_types ):
127
- if formatting is "unindexed" :
127
+ if formatting == "unindexed" :
128
128
tuples += [("{0}[]" .format (key ), element ) for element in array ]
129
- elif formatting is "indexed" :
129
+ elif formatting == "indexed" :
130
130
tuples += [("{0}[{1}]" .format (key , index ), element ) for index , element in enumerate (array )]
131
- elif formatting is "plain" :
131
+ elif formatting == "plain" :
132
132
tuples += [(key , element ) for element in array ]
133
133
else :
134
134
raise ValueError ("Invalid format provided." )
@@ -199,13 +199,13 @@ def append_url_with_query_parameters(url,
199
199
if value is not None :
200
200
if isinstance (value , list ):
201
201
value = [element for element in value if element ]
202
- if array_serialization is "csv" :
202
+ if array_serialization == "csv" :
203
203
url += "{0}{1}={2}" .format (seperator , key ,
204
204
"," .join (quote (str (x ), safe = '' ) for x in value ))
205
- elif array_serialization is "psv" :
205
+ elif array_serialization == "psv" :
206
206
url += "{0}{1}={2}" .format (seperator , key ,
207
207
"|" .join (quote (str (x ), safe = '' ) for x in value ))
208
- elif array_serialization is "tsv" :
208
+ elif array_serialization == "tsv" :
209
209
url += "{0}{1}={2}" .format (seperator , key ,
210
210
"\t " .join (quote (str (x ), safe = '' ) for x in value ))
211
211
else :
0 commit comments