-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
TypeError: unsupported operand type(s) for 'NoneType' and 'float' (using Queries) #180
Comments
This should have been fixed in version 3.3.0. Which version are you using? |
I'm using 3.3.0 |
@Mraimou ah yes, I misread. So yes, this looks like a small bug. You can probably work around it by writing |
Yes, sounds good! |
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Hello,
I'm using kpis in my report based on queries:
kpi1.expression: q1.field1
kpi2.expression: q2.field2
kpi3.expression: q1.field1 + q2.field2
I'm getting TypeError: unsupported operand type(s) for 'NoneType' and 'float' when a query returns None.
I noticed that in case of accounting expressions None is replaced by AccountingNone:
replaced_expr = aep.replace_expr(expression)
=> '(AccountingNone)'val = mis_safe_eval(replaced_expr, locals_dict)
=> AccountingNonebut in case of queries:
replaced_expr==expression
=> q1.field1 + q2.field2val = mis_safe_eval(replaced_expr, locals_dict)
=> #ERRThe text was updated successfully, but these errors were encountered: