Closed arma6655 closed 11 months ago
what is your python version ?
python3 -V
My python version is 3.9.5 but it doesn't matter really.
If I wrote something not understandably - everything works for me after restarting the bot and this was a one-off random failure that I posted so that a KeyError can be fixed - aka nothing critical. Everything that I could debug about it is in "Additional context"
sometime people missing the ".9" after "python3" command.
@hellresistor we have discussed this earlier, version 3.9 is not actually required, 3.6-3.7-3.8 will do as well. hence, using python3
does not change much.
Found that this happens when Coinbase throws 503 Got the same error again but now it started with these lines:
error: GET (503) https://api.pro.coinbase.com/accounts - ServiceUnavailable
Restarting application after exception: KeyError('currency')
error: GET (503) https://api.pro.coinbase.com/accounts - ServiceUnavailable
KeyError('currency')
Possible enhancement: wrap all requests in python try except blocks, to catch these errors early, and fail.
I think this could be a good first issue.
Describe the bug Pandas failing with KeyError: 'currency'. Was running fine for few days and randomly failed
Error
Info
Config
Additional context Feeling like this is similar to "A KeyError means the key you gave pandas isn’t valid. In your case, there is no column named “*” in the Excel file you are reading."
And browsing the code seems it's due to: https://github.com/whittlem/pycryptobot/blob/main/models/TradingAccount.py#L192 https://github.com/whittlem/pycryptobot/blob/main/models/exchange/coinbase_pro/api.py#L125 and then
df_filtered = df[df['currency'] == currency]['available']
fails as there is no such key in an empty DataFrame