manifoldpy icon indicating copy to clipboard operation
manifoldpy copied to clipboard

NUMBER isn't a known market outcome type

Open cosmojg opened this issue 10 months ago • 3 comments

After running the following snippet:

from manifoldpy import api
markets = api.get_all_markets()

I get the following output:

...
Fetched 118000 markets.
Fetched 119000 markets.
Fetched 119325 markets.
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:279, in Market.from_json(json)
    278 try:
--> 279     cls = MARKET_TYPES_MAP[json["outcomeType"]]
    280 except KeyError:

KeyError: 'NUMBER'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[4], line 1
----> 1 markets = api.get_all_markets()

File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:786, in get_all_markets(after, limit)
    776 def get_all_markets(after: int = 0, limit: int = sys.maxsize) -> List[Market]:
    777     """Get all markets.
    778     Unlike get_markets, this will get all available markets, without a limit
    779     on the number fetched.
   (...)
    784         limit: The maximum number of markets to retrieve.
    785     """
--> 786     return [Market.from_json(x) for x in _get_all_markets(after=after, limit=limit)]

File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:282, in Market.from_json(json)
    280 except KeyError:
    281     market_id = json["id"]
--> 282     raise ValueError(
    283         f'{json["outcomeType"]} isn\'t a known market outcome type. Submit a bug report for market ID {market_id}.'
    284     )
    285 return weak_structure(json, cls)

ValueError: NUMBER isn't a known market outcome type. Submit a bug report for market ID u87n1nThvUHM0GckVlHV.

cosmojg avatar Apr 09 '24 16:04 cosmojg