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

static data json URLs invalid

deekay42 opened this issue · comments

Run cass.Item(id=3040, region="EUW").name[-1]
gives an exception:


Making call: https://ddragon.leagueoflegends.com/realms/euw.json
Making call: https://ddragon.leagueoflegends.com/cdn/10.10.32161768608/data/en_GB/item.json
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/merakicommons/ghost.py", line 41, in wrapper
    return method(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cassiopeia/core/staticdata/item.py", line 434, in name
    return self._data[ItemData].name
AttributeError: 'ItemData' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/merakicommons/ghost.py", line 87, in __get__
    return self.fget(obj)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/merakicommons/ghost.py", line 43, in wrapper
    raise GhostLoadingRequiredError(str(error))
merakicommons.ghost.GhostLoadingRequiredError: 'ItemData' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/merakicommons/ghost.py", line 90, in __get__
    obj.__load__(load_group)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cassiopeia/core/common.py", line 281, in __load__
    data = configuration.settings.pipeline.get(type=self._load_types[load_group], query=query)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/datapipelines/pipelines.py", line 463, in get
    raise NotFoundError("No source returned a query result!")
datapipelines.common.NotFoundError: No source returned a query result!

In the logs I see that cass is making a call to
https://ddragon.leagueoflegends.com/cdn/10.10.32161768608/data/en_GB/item.json
which does not appear to be a valid url

Cass version is: 4.0.13

This must be because the realms data doesn't match the versions data.
https://ddragon.leagueoflegends.com/realms/na.json
http://ddragon.leagueoflegends.com/api/versions.json

I don't have a fix yet, but we'll probably have to ignore the realms when trying to identify the latest static data version.

This works now, closing.