When using the us_autocomplete client, it looks like the response.payload can return {"suggestions": None}, which trips up convert_suggestions. Maybe casting None to an empty list would be appropriate here?
In [100]: lookup = Lookup('4338 Hayman Ave, La Canada, CA 91011')
In [101]: client.send(lookup)
~/miniconda2/envs/hydra/lib/python3.8/site-packages/smartystreets_python_sdk/us_autocomplete/client.py in send(self, lookup)
27
28 result = self.serializer.deserialize(response.payload)
---> 29 suggestions = self.convert_suggestions(result.get('suggestions', []))
30 lookup.result = suggestions
31
~/miniconda2/envs/hydra/lib/python3.8/site-packages/smartystreets_python_sdk/us_autocomplete/client.py in convert_suggestions(suggestion_dictionaries)
55 @staticmethod
56 def convert_suggestions(suggestion_dictionaries):
---> 57 return [Suggestion(suggestion) for suggestion in suggestion_dictionaries]
58
59 @staticmethod
TypeError: 'NoneType' object is not iterable
Hey guys,
When using the us_autocomplete client, it looks like the
response.payload
can return{"suggestions": None}
, which trips upconvert_suggestions
. Maybe castingNone
to an empty list would be appropriate here?