mapillary / mapillary-python-sdk

A Python 3 library built on the Mapillary API v4 to facilitate retrieving and working with Mapillary data.
MIT License
37 stars 14 forks source link

Bug Report: `image_from_key` #146

Closed neverland-haha closed 1 year ago

neverland-haha commented 1 year ago

Describe the bug I have an unique ID of an image. And want to get some properties of this image. As documentation described, I use the image_from_key('1104069130447934') function. But this return 'NoneType' object is not iterable. However, when I put the url https://www.mapillary.com/map/im/1104069130447934, I got the image. What should I do?

To Reproduce

import mapillary.interface as mly
my_token = 'MLY|5175886149161658|4099af83a040b4c64a3891bdcc8314cf'
mly.set_access_token(my_token)
mly.image_from_key('1104069130447934')
 'NoneType' object is not iterable

Expected behavior A clear and concise description of what you expected to happen

Screenshots image

Additional context Add any other context about the problem here

Rubix982 commented 1 year ago

Hi, @neverland-haha! You seemed to have closed this issue. Was this resolved for you? What was the fix? Any way I can help you over this?

Let me know and thanks!

ibaiGorordo commented 11 months ago

Sorry for commenting on a close issue. I had the same issue and I think the issue is that fields is set to None by default. https://github.com/mapillary/mapillary-python-sdk/blob/904942b446bc94c3d5247af3119b542a90a2b400/src/mapillary/interface.py#L907C45-L907C49

It should be [] instead of None, then it works fine.