AttributeError: ExtensionService object has no attribute
I am creating a QlikSense dashboard that takes data from a spreadsheet (dates, restaurants, and amounts spent) I created, sends the columns to python, and has python send back the results. It has worked for a YTD summary, but when I try to create an average request, I'm receiving an error message:
ERROR - Exception calling application: 'ExtensionService' object has no attribute '_avg_spent'
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\grpc\_server.py", line 385, in _call_behavior
return behavior(argument, context), True
File "C:/Users/jtotsch/Documents/Qlik/PythonSSE-master/EatingOut/ExtensionService_Adv.py", line 165, in ExecuteFunction
AttributeError: 'ExtensionService' object has no attribute '_avg_spent'
2018-08-22 09:52:08,721 - INFO - ExecuteFunction (functionId: 0)
I've used this same code in another project, so I am not sure what the issue is.
Also, I would like to average the amounts by month and by restaurants, but I am not sure how to get python to send back two columns and how to place those columns into Qlik Sense. Any suggestions would be greatly appreciated.
The code I'm using is below.
Thanks for your assistance!
## New application with sample data
## import packages
from concurrent import futures
import ServerSideExtension_pb2 as SSE
import numpy as np
## Set a day
_ONE_DAY_IN_SECONDS = 60 * 60 *24
## An SSE-plugin
## This one is from the Column Operations example
## Class initializer
## :param funcdef_file: A function definition JSON file