Comments (5)
Are you using the SQLAlchemy engine defined globally elsewhere?
The multiprocess will try to transfer it when used but that is not valid pickle/multiprocess object. May need to establish the engine inside the callback for that to work or switch to celery.
from dash.
The engine is not a global object but a property of an object created in the callback. Roughly:
class DBHandle:
def __init__(self, url, schema):
connect_args = {...}
self.engine = sqlalchemy.create_engine(
url,
echo=True,
pool_pre_ping=True,
connect_args=connect_args,
execution_options={"schema_translate_map": {None: schema}},
)
@dash.callback(
[...]
prevent_initial_call=True,
background=True,
manager=BACKGROUND_CALLBACK_MANAGER,
)
def _callback():
dbh = DBHandle(url, schema)
I'll try with Celery if I can't find a solution but it would be nice and make development easier if it could work with a local cache.
from dash.
Could you try running your app with:
app.run(debug=True, dev_tools_prune_errors=False)
With that option the stacktrace in the screenshot should have more info to help identify which variable is causing the issue.
from dash.
Thanks for the suggestion. After some digging, I realized the SSLContext
instance is a nested property of botocore.client.S3
. This S3 client is not used in the background callback that is the source of the error, but elsewhere in the app. I guess dash serializes the whole execution environment?
from dash.
I guess dash serializes the whole execution environment?
Yes, we use multiprocess
to spawn the background process and that will try to transfer all the global variables.
from dash.
Related Issues (20)
- [BUG] dcc.Clipboard functionality broken in Notification component HOT 6
- [Feature Request] Ability to specify order of components when using pattern-matching wildcards (ALL) HOT 1
- [Feature Request] Exporting the dev tool callback graph in a standardized graph format
- [BUG] Use of `dash_duo` hangs Github Action until Timeout HOT 1
- [BUG] dbc.Modal(style) is passed to fade-modal-show layer instead modal HOT 1
- [BUG] Persistence failed in component type props
- [BUG] The dash component generation doesn't work for hyphenated props HOT 1
- [BUG] no_update is not allowed as an output to set_progress for background progress
- feat: show electrical ground symbol or similar for callbacks with no output
- [Feature Request] Is there any way to set the local and global effects of dash's callback? HOT 3
- Dropdown changes in Dash 2.17 causing page loading issues in Dash docs
- Dash 2.17.0 prevents some generated App Studio apps from running
- [BUG] set_props called multiple times only keep the last props.
- [BUG] Cannot get Dev Tools to work inside of ASGI / FastAPI application HOT 4
- [BUG] Patch += operation not working on the patch object.
- 便宜机场推荐:2024最新便宜机场
- [BUG] Fix overlay_style in dcc.Loading
- Exception: Access Denied HOT 3
- [BUG] callback dataflow display flickers at certain sizes HOT 6
- [BUG] running does not support wildcards in ids HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash.