meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No source returned a query result!

gnahz999 opened this issue · comments

I am trying to get the art/images for champions but I am getting this error when I call the loading_image attribute for skins or items.

For example,

import cassiopeia as cass 

skin = cass.get_champions()[0].skins[0]
image = skin.loading_image

throws this error

Making call: https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Aatrox_0.jpg
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~\anaconda3\envs\pds\lib\site-packages\merakicommons\cache.py in wrapper(self)
     14         try:
---> 15             return getattr(self, s)
     16         except AttributeError:

AttributeError: 'Skin' object has no attribute '_lazy__loading_image'

During handling of the above exception, another exception occurred:

NotFoundError                             Traceback (most recent call last)
d:\Users\me\Documents\test.py in <module>
----> 1 skin.loading_image

~\anaconda3\envs\pds\lib\site-packages\merakicommons\cache.py in wrapper(self)
     15             return getattr(self, s)
     16         except AttributeError:
---> 17             value = method(self)
     18             setattr(self, s, value)
     19             return value

~\anaconda3\envs\pds\lib\site-packages\cassiopeia\core\staticdata\champion.py in loading_image(self)
    463     def loading_image(self) -> PILImage:
    464         """The skin's loading screen image."""
--> 465         return configuration.settings.pipeline.get(PILImage, query={"url": self.loading_image_url})
    466 
    467 

~\anaconda3\envs\pds\lib\site-packages\datapipelines\pipelines.py in get(self, type, query)
    461                 pass
    462 
--> 463         raise NotFoundError("No source returned a query result!")
    464 
    465     def get_many(self, type: Type[T], query: Mapping[str, Any], streaming: bool = False) -> Iterable[T]:

NotFoundError: No source returned a query result!

Is this an issue with Riot's side? I made sure to set my region/key although I do not know if they are related to this issue

This one sure seems to be on Cass. I don't think this feature gets used very often so it may have broken in the last year or so. The image url that was printed out works.

I can look into this soon.

This is fixed in the latest commit. You can update your code with pip install -U git+https://github.com/meraki-analytics/cassiopeia.git