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
When a dataset is created, its extra value is null. If you apply a value to the extra field, and then later remove the value (through the UI), then it becomes an empty string (extra: ""). During the import, the application validates if the extra value is a string, and if so loads it as a dictionary, which would fail in case it's an empty string.
How to reproduce the bug
Edit an existing dataset.
Add any information to the extra value (in the UI).
Save changes.
Modify the dataset again.
Remove your text changes.
Save changes. The dataset now has extra: "".
Export the dataset.
Import it back.
Expected results
The import operation should work properly.
Actual results
The import operation fails:
Stack trace:
Traceback (most recent call last):
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps
return f(self, *args, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/views/base_api.py", line 127, in wraps
raise ex
File "/Users/vitoravila/code/superset-mods/superset/superset/views/base_api.py", line 121, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/utils/core.py", line 1523, in time_function
response = func(*args, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/utils/log.py", line 255, in wrapper
value = f(*args, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/views/base_api.py", line 108, in wraps
return f(self, *args, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/datasets/api.py", line 937, in import_
command.run()
File "/Users/vitoravila/code/superset-mods/superset/superset/datasets/commands/importers/dispatcher.py", line 68, in run
raise exc
File "/Users/vitoravila/code/superset-mods/superset/superset/datasets/commands/importers/dispatcher.py", line 57, in run
command.run()
File "/Users/vitoravila/code/superset-mods/superset/superset/commands/importers/v1/__init__.py", line 73, in run
self.validate()
File "/Users/vitoravila/code/superset-mods/superset/superset/commands/importers/v1/__init__.py", line 99, in validate
self._configs = load_configs(
File "/Users/vitoravila/code/superset-mods/superset/superset/commands/importers/v1/utils.py", line 186, in load_configs
schema.load(config)
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/marshmallow/schema.py", line 722, in load
return self._do_load(
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/marshmallow/schema.py", line 851, in _do_load
processed_data = self._invoke_load_processors(
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/marshmallow/schema.py", line 1095, in _invoke_load_processors
data = self._invoke_processors(
File "/Users/vitoravila/.pyenv/versions/3.9.0/envs/superset-mods/lib/python3.9/site-packages/marshmallow/schema.py", line 1225, in _invoke_processors
data = processor(data, many=many, **kwargs)
File "/Users/vitoravila/code/superset-mods/superset/superset/datasets/schemas.py", line 208, in fix_extra
data["extra"] = json.loads(data["extra"])
File "/Users/vitoravila/.pyenv/versions/3.9.0/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/vitoravila/.pyenv/versions/3.9.0/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/vitoravila/.pyenv/versions/3.9.0/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Environment
browser type and version: Chrome 114.0.5735.198
superset version: Superset 0.0.0-dev (master)
python version: 3.9.0
node.js version: v16.14.2
Checklist
I have checked the superset logs for python stacktraces and included it here as text if there are any.
I have reproduced the issue with at least the latest released version of superset.
I have checked the issue tracker for the same issue and I haven't found one similar.
The text was updated successfully, but these errors were encountered:
When a dataset is created, its
extra
value isnull
. If you apply a value to theextra
field, and then later remove the value (through the UI), then it becomes an empty string (extra: ""
). During the import, the application validates if theextra
value is a string, and if so loads it as a dictionary, which would fail in case it's an empty string.How to reproduce the bug
extra
value (in the UI).extra: ""
.Expected results
The import operation should work properly.
Actual results
The import operation fails:
Stack trace:
Environment
114.0.5735.198
Superset 0.0.0-dev
(master)3.9.0
v16.14.2
Checklist
The text was updated successfully, but these errors were encountered: