trendmanagement / tmqrexo_alexveden

1 stars 1 forks source link

Alex Task help me solve this bug please, 10 min Task #203

Open spickering-git opened 6 years ago

spickering-git commented 6 years ago

Why does this code image

fail here https://github.com/trendmanagement/tmqrexo_alexveden/blob/dca33b21ecd83497d5759c030ceb57e158de2bf0/scripts/smart_campaign_daily.py#L71

and throw XXX lineno: 71, opcode: 0 unknown opcode

It is running your code to get the pnls Then tries to extract pnls and crashes.

alexveden commented 6 years ago

image Try to understand what pnl_values are. I believe that pnl_values is dictionary and the 'SettleChange' is pandas dataframe. Probably it's empty.

spickering-git commented 6 years ago

same code works in notebook here https://10.0.1.2:8888/notebooks/tools/All_Production_Campaign_Settlements-Product-Separated_Pnls-TEST-Loop.ipynb image

so maybe some sort of version bug? @alexveden what do you think?

alexveden commented 6 years ago

@spickering-git it's hard to say without seeing contents of pnl_values['pnls']['SettleChange'] in the debugger.

Try to delete try/catch block to see the traceback this error, or launch it in the debugger.