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

RunnerCatalogue metadata can be empty/non-existent (eg non-horse events) #69

Closed
oughtotrade opened this issue May 11, 2017 · 2 comments
Closed

Comments

@oughtotrade
Copy link
Contributor

In the betfair documentation, a RunnerCatalogue's metadata is not mandatory. For some sports/events, particularly non-horse racing, metadata is not returned. Betfair RunnerCatalog

However in bettingresources.py#L190, metadata is configured as mandatory.

Since release 1.1.2, list_market_catalogue method fails when it tries to make RunnerCatalogue resources as part of the MarketCatalogue resource.

In this traceback, debugging showed that there was no metadata in the runners returned by listMarketCatalogue: {u'handicap': 0.0, u'runnerName': u'San Antonio Spurs', u'selectionId': 237471, u'sortPriority': 1}

Traceback:

Traceback (most recent call last):
  File "anon-app.py", line 63, in <module>
    jobs.update_market_subscription_list()
  File "/home/anon/github/anon-app/jobs/job.py", line 185, in update_market_subscription_list
    market_id_list = self.betfair_api.betting.list_market_catalogue(market_filter, market_projection=market_projection, max_results=100, lightweight=False)
  File "/home/anon/.virtualenvs/anon-app/local/lib/python2.7/site-packages/betfairlightweight/endpoints/betting.py", line 158, in list_market_catalogue
    return self.process_response(response, resources.MarketCatalogue, elapsed_time, lightweight)
  File "/home/anon/.virtualenvs/anon-app/local/lib/python2.7/site-packages/betfairlightweight/endpoints/baseendpoint.py", line 100, in process_response
    return [resource(elapsed_time=elapsed_time, **x) for x in result]
  File "/home/anon/.virtualenvs/anon-app/local/lib/python2.7/site-packages/betfairlightweight/resources/bettingresources.py", line 222, in __init__
    self.runners = [RunnerCatalogue(**i) for i in kwargs.get('runners', [])]
TypeError: __init__() takes exactly 6 arguments (5 given)
@liampauling
Copy link
Member

Sorry missed this, just pushed 1.1.3 through to PyPi, let me know if you find anymore.

@oughtotrade
Copy link
Contributor Author

No problem! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants