You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the league_entries.fives feature to retrieve solo queue entries for a summoner participating in the Arena game mode. A ValueError is raised because the Queue enum does not contain the Queue ID for Arena games, specifically "CHERRY."
The error occurs when the summoner has played Arena, and the Queue enum attempts to handle it without the proper Queue ID. However, this error will not occur to any summoner who has not played Arena.
ValueError: 'CHERRY' is not a valid Queue
Resolved by adding the "CHERRY" to the 'Data.Queue' enum.
Code to Replicate:
importcassiopeiaascassfromcassiopeia.dataimportQueuefromcassiopeia.coreimportAccount, Summonerdefprint_leagues(name: str, tagline: str, region: str):
account=Account(name=name, tagline=tagline, region=region)
print("Name:", account.name)
print("ID:", account.summoner.id)
entries=account.summoner.league_entriesifentries.fivesisnotNone:
print(f"\nQueue: {entries.fives.queue}")
print(f"Tier: {entries.fives.tier}")
print(f"Division: {entries.fives.division}")
print(f"Wins: {entries.fives.wins}")
print(f"Losses: {entries.fives.losses}\n")
else:
print("The summoner has not played Ranked Fives.")
if__name__=="__main__":
# Account without Arena Gamesprint_leagues("smurftocarryjm", "4483", "PH")
# Account with Arena Gamesprint_leagues("outofmana", "AHRI", "PH")
# Account with Arena and no Rank Games# print_leagues("KaiserV", "GOW", "PH")# Account without Arena games# print_leagues("Pobelter", "NA1", "NA")
Full traceback when attempting to retrieve league_entries.fives for a summoner who has played Arena games:
Name: outofmana
Making call: https://asia.api.riotgames.com/riot/account/v1/accounts/by-riot-id/outofmana/AHRI
Making call: https://ph2.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/xxDFu30gd9_kx8texxXhZouqOEIRGwuKW3FirpsTZYE8zliHztG2yV0MCRT-pWy4z6JD8qNTzYd48A
ID: JtlNHePz0_iWMqjp84SszBjTSiAdfYDlQkrA9iicUOYKLwpPdIkX4FuRiQ
Making call: https://ph2.api.riotgames.com/lol/league/v4/entries/by-summoner/JtlNHePz0_iWMqjp84SszBjTSiAdfYDlQkrA9iicUOYKLwpPdIkX4FuRiQ
Traceback (most recent call last):
File "E:\Python\Lib\site-packages\merakicommons\cache.py", line 15, in wrapper
return getattr(self, s)
^^^^^^^^^^^^^^^^
AttributeError: 'LeagueSummonerEntries' object has no attribute '_lazy__fives'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Python\Lib\site-packages\merakicommons\cache.py", line 15, in wrapper
return getattr(self, s)
^^^^^^^^^^^^^^^^
AttributeError: 'LeagueEntry' object has no attribute '_lazy__queue'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "e:\Github\LOL_DATAGATHERING_THESIS_2\RiotAPI\testing.py", line 31, in <module>
print_leagues("outofmana", "AHRI", "PH")
File "e:\Github\LOL_DATAGATHERING_THESIS_2\RiotAPI\testing.py", line 16, in print_leagues
if entries.fives is not None:
^^^^^^^^^^^^^
File "E:\Python\Lib\site-packages\merakicommons\cache.py", line 17, in wrapper
value = method(self)
^^^^^^^^^^^^
File "E:\Python\Lib\site-packages\cassiopeia\core\league.py", line 392, in fives
if entry.queue is Queue.ranked_solo_fives:
^^^^^^^^^^^
File "E:\Python\Lib\site-packages\merakicommons\cache.py", line 17, in wrapper
value = method(self)
^^^^^^^^^^^^
File "E:\Python\Lib\site-packages\cassiopeia\core\league.py", line 229, in queue
return Queue(self._data[LeagueEntryData].queue)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Python\Lib\enum.py", line 712, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Python\Lib\enum.py", line 1128, in __new__
raise ve_exc
ValueError: 'CHERRY' is not a valid Queue
The text was updated successfully, but these errors were encountered:
CarlVictorV
added a commit
to CarlVictorV/cassiopeia
that referenced
this issue
Aug 27, 2024
This commit fixes the issue where a ValueError is raised when retrieving league_entries.fives for a summoner who has played Arena games. By adding "CHERRY" to the Queue enum, the error is resolved.
This commit fixes the issue where a ValueError is raised when retrieving league_entries.fives for a summoner who has played Arena games. By adding "CHERRY" to the Queue enum, the error is resolved.
When using the league_entries.fives feature to retrieve solo queue entries for a summoner participating in the Arena game mode. A ValueError is raised because the Queue enum does not contain the Queue ID for Arena games, specifically "CHERRY."
The error occurs when the summoner has played Arena, and the Queue enum attempts to handle it without the proper Queue ID. However, this error will not occur to any summoner who has not played Arena.
Resolved by adding the "CHERRY" to the 'Data.Queue' enum.
Code to Replicate:
Full traceback when attempting to retrieve league_entries.fives for a summoner who has played Arena games:
The text was updated successfully, but these errors were encountered: