Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get tournament bug #50

Open
Serezha139 opened this issue Apr 10, 2022 · 1 comment
Open

Get tournament bug #50

Serezha139 opened this issue Apr 10, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Serezha139
Copy link

  • berserk version: 0.11.8
  • Python version: 3.8
  • Operating System: macOS monterrey 12.1

Description

trying to get tournament data

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

class LichessDataLoadService:
def init(self):
session = berserk.TokenSession(settings.BNL_TOKEN)
self.client = berserk.Client(session=session)

def get_tournament_data(self, tournament_id):
    data = self.client.tournaments.get_tournament(tournament_id)
    return data

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "/Users/givanov/PycharmProjects/bnl_landing/bnl_league/bnl_league/common/services/lichess_api_service.py", line 11, in get_tournament_data
data = self.client.tournaments.get_tournament(tournament_id)
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/clients.py", line 995, in get_tournament
return self._r.get(path, converter=models.Tournaments.convert_values)
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/session.py", line 60, in get
return self.request('GET', *args, **kwargs)
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/session.py", line 56, in request
return fmt.handle(response, is_stream=is_stream, converter=converter)
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/formats.py", line 35, in handle
return converter(self.parse(response))
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/models.py", line 27, in convert_values
data[k] = cls.convert(data[k])
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/models.py", line 16, in convert
return cls.convert_one(data)
File "/Users/givanov/PycharmProjects/bnl_landing/venv/lib/python3.8/site-packages/berserk/models.py", line 20, in convert_one
for k in set(data) & set(cls.conversions):
TypeError: 'int' object is not iterable

@rhgrant10 rhgrant10 added the bug Something isn't working label Apr 15, 2022
@rhgrant10
Copy link
Owner

Hi @Serezha139 , not sure how to reproduce this. There hasn't been a v0.11.8 of berserk and the latest version doesn't contain a client.tournaments.get_tournament method. Can you help me understand what you're trying to do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants