predicthq/sdk-py

It's not possible to retrieve events based using list of Places

Closed this issue · 1 comments

Currently it's not possible to use a list as a parameter for place when retrieving events.
It returns the following error:
schematics.exceptions.DataError: {'place': ConversionError("Please use a mapping for this field or Place instance instead of list.", info=None)}

Now we can workaround creating a list and calling search with place={'scope': places}.

Hi there @sergioropero,
This is working as expected because we support 2 types of place parameter. One of them is the one you mentioned - scope, when it is used results will contain events that apply to the parent and children places of the specified place.

There is also another one called exact and when is it used results will contain events that apply to the specified place only.

So when using the SDK you would need to decide yourself what sort of place search you want to perform and either use place={'scope': LIST OF PLACE IDS} or place={'exact': LIST OF PLACE IDS}.

You can read more about it in our dev docs.

If you have any more questions please let me know 🙂

Thanks,
Vadim.