What I’m trying to do:
I am trying to access a google sheet from a server module but am getting this error:
RecursionError: Maximum call stack size exceeded
at anvil-services/anvil/google/sheets.py, line 26 column 8
called from anvil-services/anvil/google/sheets.py, line 26 column 8
..1000x times...
called from anvil-services/anvil/google/sheets.py, line 26 column 8
called from Form1, line 39
What I’ve tried and what’s not working:
When I try is from the client it works fine, but when the “same” code runs on the server I get this recursion error.
Code Sample:
# in a form...
def button_3_click(self, **event_args):
"""This method is called when the button is clicked"""
db = app_files.transactions
results = db['Sheet1'].rows
print("Client: ",len(results))
def button_4_click(self, **event_args):
"""This method is called when the button is clicked"""
results = anvil.server.call('get_it')
print("Server:", len(results))
....
#server code:
from anvil.google.drive import app_files
import anvil.server
@anvil.server.callable
def get_it():
db = app_files.transactions
results = db['Sheet1'].rows
return results
and the output is
Client: 17
RecursionError: Maximum call stack size exceeded
at anvil-services/anvil/google/sheets.py, line 26 column 8
called from anvil-services/anvil/google/sheets.py, line 26 column 8
called from anvil-services/anvil/google/sheets.py, line 26 column 8
called from anvil-services/anvil/google/sheets.py, line 26 column 8
called from anvil-services/anvil/google/sheets.py, line 26 column 8
..1000x..
called from anvil-services/anvil/google/sheets.py, line 26 column 8
called from Form1, line 39