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.
MIT License
553 stars 134 forks source link

Error with custom cache settings #228

Closed xEcEz closed 6 years ago

xEcEz commented 6 years ago

After modifying the cache expirations settings in my custom config file, the following error is thrown at execution time:

 File "cass_test.py", line 17, in dummySummoner
    summo = Summoner(name=summonerName, region="EUW")
  File "/usr/local/lib/python3.6/dist-packages/cassiopeia/core/common.py", line 214, in __call__
    return pipeline.get(cls, query=query)
  File "/usr/local/lib/python3.6/dist-packages/datapipelines/pipelines.py", line 459, in get
    return handler.get(query, context)
  File "/usr/local/lib/python3.6/dist-packages/datapipelines/pipelines.py", line 190, in get
    sink.put(result, context)
  File "/usr/local/lib/python3.6/dist-packages/datapipelines/pipelines.py", line 140, in put
    self._sink.put(self._store_type, item, context)
  File "/usr/local/lib/python3.6/dist-packages/datapipelines/sinks.py", line 64, in wrapper
    raise DataSink.unsupported(type)
datapipelines.common.UnsupportedError: The type "Summoner" is not supported by this DataSink!

The custom config file:

{
  "global": {
    "version_from_match": "patch",
    "default_region": null,
    "enable_ghost_loading": true
  },
  "plugins": {},
  "pipeline": {
    "Cache": {
      "expirations": {
        "ChampionStatusData": "datetime.timedelta(hours=6)",
        "ChampionStatusListData": "datetime.timedelta(hours=6)",
        "Realms": "datetime.timedelta(hours=6)",
        "Versions": "datetime.timedelta(hours=6)",
        "Champion": "datetime.timedelta(days=20)",
        "Rune": "datetime.timedelta(days=20)",
        "Item": "datetime.timedelta(days=20)",
        "SummonerSpell": "datetime.timedelta(days=20)",
        "Map": "datetime.timedelta(days=20)",
        "ProfileIcon": "datetime.timedelta(days=20)",
        "Locales": "datetime.timedelta(days=20)",
        "LanguageStrings": "datetime.timedelta(days=20)",
        "SummonerSpells": "datetime.timedelta(days=20)",
        "Items": "datetime.timedelta(days=20)",
        "Champions": "datetime.timedelta(days=20)",
        "Runes": "datetime.timedelta(days=20)",
        "Maps": "datetime.timedelta(days=20)",
        "ProfileIcons": "datetime.timedelta(days=20)",
        "ChampionMastery": "datetime.timedelta(days=7)",
        "ChampionMasteries": "datetime.timedelta(days=7)",
        "LeagueEntries": "datetime.timedelta(hours=6)",
        "League": "datetime.timedelta(hours=6)",
        "ChallengerLeague": "datetime.timedelta(hours=6)",
        "MasterLeague": "datetime.timedelta(hours=6)",
        "Match": "datetime.timedelta(days=3)",
        "Timeline": "datetime.timedelta(days=3)",
        "Summoner": "datetime.timedelta(days=1)",
        "ShardStatus": "datetime.timedelta(hours=1)",
        "CurrentMatch": "datetime.timedelta(hours=0.5)",
        "FeaturedMatches": "datetime.timedelta(hours=0.5)"
      }
    },
    "DDragon": {},
    "RiotAPI": {
      "api_key": "..."
    }
  },
  "logging": {
    "print_calls": true,
    "print_riot_api_key": false,
    "default": "WARNING",
    "core": "WARNING"
  }
}
jjmaldonis commented 6 years ago

Hey, json can't read that format so you have to put in the amount of time in seconds as an int instead.

xEcEz commented 6 years ago

Ok, thanks.