Code Monkey home page Code Monkey logo

Comments (1)

dosubot avatar dosubot commented on August 28, 2024 3

The warning "Class 'werkzeug.local.LocalProxy' is not mapped" in your logs while using Superset version 4.0.1 with Python 3.11 is likely due to the use of LocalProxy objects in the Superset code. This warning typically occurs when SQLAlchemy or another ORM tool tries to map or interact with a class that it doesn't recognize as a mapped entity.

In the superset/__init__.py file, LocalProxy is used to create proxies for various configurations and caches:

from werkzeug.local import LocalProxy

conf = LocalProxy(lambda: current_app.config)
results_backend = LocalProxy(lambda: results_backend_manager.results_backend)
results_backend_use_msgpack = LocalProxy(lambda: results_backend_manager.should_use_msgpack)
data_cache = LocalProxy(lambda: cache_manager.data_cache)
thumbnail_cache = LocalProxy(lambda: cache_manager.thumbnail_cache)

To resolve this warning, you can ensure that these LocalProxy objects are not being inadvertently passed to SQLAlchemy or any other ORM that expects a mapped class. If these proxies are being used in a context where they might be interpreted as entities, you might need to refactor the code to avoid such usage.

For example, you can access the actual object behind the proxy before passing it to SQLAlchemy:

# Instead of passing the proxy directly, access the underlying object
actual_results_backend = results_backend._get_current_object()
# Use actual_results_backend in your ORM operations

This approach ensures that the ORM interacts with the actual object rather than the proxy, thus avoiding the warning [1].

Additionally, there has been a recent update in the Superset codebase that addresses this warning. The update is mentioned in the CHANGELOG/4.0.0.md file under the version 4.0.0 section:

- [#27164](https://github.com/apache/superset/pull/27164) fix: unlock and bump werkzeug (@dpgaspar)

This update includes changes that address the warning related to werkzeug.local.LocalProxy [2][3].

To continue talking to Dosu, mention @dosu.

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.