k7daniel commented on issue #25620:
URL: https://github.com/apache/superset/issues/25620#issuecomment-2077449815

   Hey @longtomjr I am having this same issue here after upgrading from 2.1 to 
4.0
   How and where do you run the python script above? I tried to run it from the 
superset_app container with python3 script.py from the /app directory and I got 
a message from SQL Alchemy complaining about not having an app.
   ```
   Traceback (most recent call last):
   File 
"/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 
1008, in call
   return self.registry[key]
   KeyError: <greenlet.greenlet object at 0x7fabb09341c0 (otid=0x7fabb13ac5d0) 
current active started main>
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
   File "/app/mig.py", line 31, in <module>
   db.session.query(KeyValueEntry).filter(
   File "<string>", line 2, in query
   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py", 
line 24, in _proxied
   return self.registry()
   File 
"/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_collections.py", line 
1010, in call
   return self.registry.setdefault(key, self.createfunc())
   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", 
line 4209, in call
   return self.class_(**local_kw)
   File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", 
line 174, in init
   [self.app](https://self.app/) = app = db.get_app()
   File "/usr/local/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", 
line 1042, in get_app
   raise RuntimeError(
   RuntimeError: No application found. Either work inside a view function or 
push an application context. See 
[http://flask-sqlalchemy.pocoo.org/contexts/.](http://flask-sqlalchemy.pocoo.org/contexts/)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to