alexray92 opened a new issue, #34291:
URL: https://github.com/apache/superset/issues/34291

   ### Bug description
   
   I developed a dashboard on one Superset instance, which I recently upgraded 
from 4.0.1 to 4.1.2.  The dashboard there works fine.  But after exporting the 
dashboard then importing it to a new 4.1.2 instance, the dashboard gives this 
error on load: "Error loading chart datasources. Filters may not work 
correctly."
   
   However, all charts appear to function correctly and all filters appear to 
work.  I tried this:
   
   1. Delete all charts and datasets and dashboards and re-try import
   2. Make a new export and try importing it
   3. Export the problematic dashboard and then try re-importing it to the same 
instance
   4. Upgrade then to 4.1.3 and try re-importing dashboard
   
   #3 failed on import with this error (on 4.1.2):
   
   (see additional context)
   
   Additionally, the error on the dashboard seems to be because the following 
API call (both 4.1.2 and 4.1.3): 
   
   (see additional context)
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.1.3
   
   ### Python version
   
   3.10
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   Export/Import problem dashboard error
   `2025-07-23 
17:12:36,507:ERROR:superset.commands.dashboard.importers.dispatcher:Error 
running import command
   Traceback (most recent call last):
     File "/app/superset/commands/importers/v1/__init__.py", line 76, in run
       self._import(self._configs, self.overwrite)
     File "/app/superset/commands/dashboard/importers/v1/__init__.py", line 
117, in _import
       config = update_chart_config_dataset(config, dataset_dict)
     File "/app/superset/commands/utils.py", line 217, in 
update_chart_config_dataset
       query_context["form_data"]["datasource"] = dataset_uid
   TypeError: 'str' object does not support item assignment
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/app/superset/commands/dashboard/importers/dispatcher.py", line 57, 
in run
       command.run()
     File "/app/superset/utils/decorators.py", line 266, in wrapped
       return on_error(ex)
     File "/app/superset/utils/decorators.py", line 236, in on_error
       raise ex
     File "/app/superset/utils/decorators.py", line 259, in wrapped
       result = func(*args, **kwargs)
     File "/app/superset/commands/importers/v1/__init__.py", line 80, in run
       raise self.import_error() from ex
   superset.commands.dashboard.exceptions.DashboardImportError: Import 
dashboard failed for an unknown reason
   2025-07-23 
17:12:36,508:WARNING:superset.views.error_handling:CommandException
   Traceback (most recent call last):
     File "/app/superset/commands/importers/v1/__init__.py", line 76, in run
       self._import(self._configs, self.overwrite)
     File "/app/superset/commands/dashboard/importers/v1/__init__.py", line 
117, in _import
       config = update_chart_config_dataset(config, dataset_dict)
     File "/app/superset/commands/utils.py", line 217, in 
update_chart_config_dataset
       query_context["form_data"]["datasource"] = dataset_uid
   TypeError: 'str' object does not support item assignment
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in 
full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in 
dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
     File 
"/usr/local/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py",
 line 95, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/views/base_api.py", line 119, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
     File "/app/superset/utils/core.py", line 1364, in time_function
       response = func(*args, **kwargs)
     File "/app/superset/utils/log.py", line 303, in wrapper
       value = f(*args, **kwargs)
     File "/app/superset/views/base_api.py", line 106, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/dashboards/api.py", line 1408, in import_
       command.run()
     File "/app/superset/commands/dashboard/importers/dispatcher.py", line 57, 
in run
       command.run()
     File "/app/superset/utils/decorators.py", line 266, in wrapped
       return on_error(ex)
     File "/app/superset/utils/decorators.py", line 236, in on_error
       raise ex
     File "/app/superset/utils/decorators.py", line 259, in wrapped
       result = func(*args, **kwargs)
     File "/app/superset/commands/importers/v1/__init__.py", line 80, in run
       raise self.import_error() from ex
   superset.commands.dashboard.exceptions.DashboardImportError: Import 
dashboard failed for an unknown reason`
   
   ----
   GET api/v1/dashboard/5/datasets
   
   returns
   
   `{"message":"Fatal error"}
   
   2025-07-23 21:49:23,567:ERROR:flask_appbuilder.api:'str' object has no 
attribute 'get'
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.10/site-packages/flask_appbuilder/api/__init__.py", 
line 111, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/views/base_api.py", line 119, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
     File "/app/superset/utils/core.py", line 1364, in time_function
       response = func(*args, **kwargs)
     File "/app/superset/utils/log.py", line 303, in wrapper
       value = f(*args, **kwargs)
     File "/app/superset/dashboards/api.py", line 420, in get_datasets
       datasets = DashboardDAO.get_datasets_for_dashboard(id_or_slug)
     File "/app/superset/daos/dashboard.py", line 81, in 
get_datasets_for_dashboard
       return dashboard.datasets_trimmed_for_slices()
     File "/app/superset/models/dashboard.py", line 283, in 
datasets_trimmed_for_slices
       result.append(datasource.data_for_slices(slices))
     File "/app/superset/connectors/sqla/models.py", line 446, in 
data_for_slices
       query_context = slc.get_query_context()
     File "/app/superset/models/slice.py", line 289, in get_query_context
       return self.get_query_context_factory().create(
     File "/app/superset/common/query_context_factory.py", line 63, in create
       if form_data and form_data.get("slice_id") is not None:
   AttributeError: 'str' object has no attribute 'get'`
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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.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