You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm building a multi-page Dash application. It utilises functionality from the dash-extensions package, however I experience issues when I want to use a dash-uploader callback function.
The error I get is: AttributeError: 'DashProxy' object has no attribute 'blueprint'.
I managed to figure out that it occurs, because the DashProxy's callback method is using the blueprint attribute, however the du.callback is trying to call it before the attribute is assigned to the instance. I don't know how to work around this issue.
Note: I'm not sure if dash-uploader is supposed to work with dash-extensions and this is an issue or rather a feature request.
Here's how the code is structured:
app.py:
from dash_extensions.enrich import DashProxy, ServersideOutputTransform
app = DashProxy(__name__, use_pages=True, transforms=[ServersideOutputTransform()])
Traceback (most recent call last):
File "/Users/user/PycharmProjects/machine-learning/ROICalculator/ticket_analysis/app.py", line 16, in <module>
app = DashProxy(__name__, use_pages=True, transforms=[ServersideOutputTransform()])
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash_extensions/enrich.py", line 352, in __init__
super().__init__(*args, **kwargs)
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash/dash.py", line 494, in __init__
self.init_app()
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash/dash.py", line 578, in init_app
self.enable_pages()
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash/dash.py", line 2044, in enable_pages
self._import_layouts_from_pages()
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash/dash.py", line 2016, in _import_layouts_from_pages
spec.loader.exec_module(page_module)
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/user/PycharmProjects/machine-learning/ROICalculator/ticket_analysis/pages/file_upload.py", line 101, in <module>
def get_a_list(filenames):
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash_uploader/callbacks.py", line 105, in add_callback
dash_callback = settings.app.callback(
File "/Users/user/virtualenv/ticket-analysis/lib/python3.8/site-packages/dash_extensions/enrich.py", line 358, in callback
return self.blueprint.callback(*args, **kwargs)
AttributeError: 'DashProxy' object has no attribute 'blueprint'
The text was updated successfully, but these errors were encountered:
I managed to resolve my issue by unwrapping the du.callback method within my own page definition.
The change is that instead of calling app.callback which would have used DashProxy.callback we now call callback which is imported from dash. By doing this we are bypassing the issue that the blueprint attribute doesn't yet exist for the DashProxy instance.
I will keep the issue as Open, since there still might be a fix or a documentation update within the dash-uploader project to better accommodate integration with dash-extensions.
Here is an example:
app.py:
from dash_extensions.enrich import DashProxy, ServersideOutputTransform
app = DashProxy(__name__, use_pages=True, transforms=[ServersideOutputTransform()])
Hi,
I'm building a multi-page Dash application. It utilises functionality from the
dash-extensions
package, however I experience issues when I want to use adash-uploader
callback function.The error I get is:
AttributeError: 'DashProxy' object has no attribute 'blueprint'.
I managed to figure out that it occurs, because the DashProxy's
callback
method is using theblueprint
attribute, however thedu.callback
is trying to call it before the attribute is assigned to the instance. I don't know how to work around this issue.Note: I'm not sure if
dash-uploader
is supposed to work withdash-extensions
and this is an issue or rather a feature request.Here's how the code is structured:
app.py:
file_upload.py:
Here is the full Traceback:
The text was updated successfully, but these errors were encountered: