akaszynski/keepa

query(buybox=True) started throwing an error

geoffstowe opened this issue · 2 comments

I started getting the below error when running this code...removing buybox=True doesn't throw the error, so I think one of the buybox fields changed in the keepa responses.

keepa_client = keepa.Keepa("some_keepa_key")
asin = "some_asin"
product_info = keepa_client.query(
            asin, stats=1, buybox=True, progress_bar=False, history=True, rating=True
        )[0]
Generates this error:
../../../Library/Caches/pypoetry/virtualenvs/predly-CJkTdUsu-py3.7/lib/python3.7/site-packages/keepa/interface.py:742: in query
    raw=raw,
../../../Library/Caches/pypoetry/virtualenvs/predly-CJkTdUsu-py3.7/lib/python3.7/site-packages/keepa/interface.py:875: in _product_query
    product['stats_parsed'] = _parse_stats(stats, to_datetime)
../../../Library/Caches/pypoetry/virtualenvs/predly-CJkTdUsu-py3.7/lib/python3.7/site-packages/keepa/interface.py:139: in _parse_stats
    stat_value_item = normalize_value(stat_value_item)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

v = {'avgNewOfferCount': 1, 'avgPrice': 500, 'domainId': 1, 'isFBA': True, ...}

    def normalize_value(v):
>       if v < 0:
E       TypeError: '<' not supported between instances of 'dict' and 'int'

../../../Library/Caches/pypoetry/virtualenvs/predly-CJkTdUsu-py3.7/lib/python3.7/site-packages/keepa/interface.py:121: TypeError

@geoffstowe, looks like the keepa API was modified (and reverted).

I'm in conversation with the owner of the API and will likely have to submit a hotfix shortly, but prior to the next change of the API.

@geoffstowe, looks like the keepa API was modified (and reverted).

I'm in conversation with the owner of the API and will likely have to submit a hotfix shortly, but prior to the next change of the API.

Thank you Alex!