You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/10 15:58:51 UTC

[GitHub] [superset] EBoisseauSierra opened a new issue #19103: CLI import fails when a dataset column has empty `extra` specified

EBoisseauSierra opened a new issue #19103:
URL: https://github.com/apache/superset/issues/19103


   `superset import-dashboards` fails when a dataset has its “Extra” details specified… but empty (i.e. `{}`).
   
   #### How to reproduce the bug
   
   1. Specify the Extra field:
     1. Go to Data/Datasets menu,
     1. Click on Edit dataset,
     1. Click on Use legacy Editor,
     1. In Edit Table/Detail tab, scroll to the last row and specify Extra as `{}`. 
   2. Export instance: `superset export-dashboards --file my_archive.zip`
   3. Change instance (should you want to)
   3. Import instance: `superset import-dashboards --path my_archive.zip`
   
   ### Expected results
   
   JustWorks™
   
   ### Actual results
   
   ```
   $ superset import-dashboards --path my_archive.zip
   …
   Command failed validation
   2022-03-09 14:32:11,353:INFO:superset.dashboards.commands.importers.dispatcher:Command failed validation
   There was an error when importing the dashboards(s), please check the exception traceback in the log
   Traceback (most recent call last):
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/cli.py", line 360, in import_dashboards
       ImportDashboardsCommand(contents, overwrite=True).run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 64, in run
       raise exc
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 57, in run
       command.run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 63, in run
       self.validate()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 161, in validate
       raise exception
   superset.commands.exceptions.CommandInvalidError: Error importing dashboard
   Segmentation fault
   ```
   
   ### Environment
   
   - superset version: `1.4.1`
   - python version: `3.7`
   - any feature flags active: `"VERSIONED_EXPORT": True`.
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   I've tracked down the Exception be first thrown by the Marshmallow (version `3.14.1` — current latest) definition, and more precisely [this module](https://github.com/marshmallow-code/marshmallow/blob/3.14.1/src/marshmallow/fields.py).
   
   The Exception I get from Superset looks like:
   
   ```
   [ValidationError({'columns': {0: {'extra': ['Not a valid mapping type.']}, 1: {'extra': ['Not a valid mapping type.']}})]
   ```
   (where `0`, and `1` are the rank of the columns I have implemented the empty Extra field in).
   
   The `Not a valid mapping type` is [this one](https://github.com/marshmallow-code/marshmallow/blob/3.14.1/src/marshmallow/fields.py#L1510).
   
   I can see that, back on Superset's side, the [`ImportModelsCommand.contents.items()](https://github.com/apache/superset/blob/1.4.1rc2/superset/commands/importers/v1/__init__.py#L101) to be validated contains the following (beautified manually):
   
   ```
   dict_items([…,
       (
           'datasets/my_db/my_table.yaml',
           '
           cache_timeout: null
           columns:
           - {column_name: timestamp, description: null, expression: null, extra: \'{}\', filterable: true,
     groupby: true, is_active: true, is_dttm: true, python_date_format: null, type: TIMESTAMP
       WITH TIME ZONE, verbose_name: null}
         …
   ```
   
   What is interesting is the `extra: \'{}\',` part, that is likely causing the issue, and raises [this exception](https://github.com/marshmallow-code/marshmallow/blob/3.14.1/src/marshmallow/fields.py#L1585) that then “bubbles up”.
   
   ---
   
   As an interesting bonus, the Python stack traces not always ends up with 
   
   ```
   …
   superset.commands.exceptions.CommandInvalidError: Error importing dashboard
   Segmentation fault
   ```
   
   as mentioned above. I have also faced:
   
   ```
   2022-03-10 15:56:55,214:INFO:superset.dashboards.commands.importers.dispatcher:Command failed validation
   There was an error when importing the dashboards(s), please check the exception traceback in the log
   Traceback (most recent call last):
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/cli.py", line 360, in import_dashboards
       ImportDashboardsCommand(contents, overwrite=True).run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 64, in run
       raise exc
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 57, in run
       command.run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 63, in run
       self.validate()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 161, in validate
       raise exception
   superset.commands.exceptions.CommandInvalidError: Error importing dashboard
   Traceback (most recent call last):
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/cli.py", line 360, in import_dashboards
       ImportDashboardsCommand(contents, overwrite=True).run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 64, in run
       raise exc
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 57, in run
       command.run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 63, in run
       self.validate()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 161, in validate
       raise exception
   superset.commands.exceptions.CommandInvalidError: Error importing dashboard
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/opt/superset/venv/bin/superset", line 33, in <module>
       sys.exit(load_entry_point('apache-superset==1.4.1', 'console_scripts', 'superset')())
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
       return self.main(*args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/flask/cli.py", line 586, in main
       return super(FlaskGroup, self).main(*args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
       rv = self.invoke(ctx)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/flask/cli.py", line 426, in decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/flask/cli.py", line 426, in decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/cli.py", line 363, in import_dashboards
       "There was an error when importing the dashboards(s), please check "
     File "/usr/lib/python3.7/logging/__init__.py", line 1418, in exception
       self.error(msg, *args, exc_info=exc_info, **kwargs)
     File "/usr/lib/python3.7/logging/__init__.py", line 1412, in error
       self._log(ERROR, msg, args, **kwargs)
     File "/usr/lib/python3.7/logging/__init__.py", line 1519, in _log
       self.handle(record)
     File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle
       self.callHandlers(record)
     File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers
       hdlr.handle(record)
     File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle
       self.emit(record)
     File "/opt/superset/venv/lib/python3.7/site-packages/systemd/journal.py", line 157, in emit
       send(**data)
     File "systemd/_journal.pyx", line 68, in systemd._journal.send
     File "systemd/_journal.pyx", line 48, in systemd._journal._send
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/exceptions.py", line 31, in __repr__
       return repr(self)
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/exceptions.py", line 31, in __repr__
       return repr(self)
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/exceptions.py", line 31, in __repr__
       return repr(self)
     [Previous line repeated 320 more times]
   RecursionError: maximum recursion depth exceeded while getting the repr of an object
   ```
   
   and
   
   ```
   Command failed validation
   2022-03-10 15:44:46,566:INFO:superset.dashboards.commands.importers.dispatcher:Command failed validation
   There was an error when importing the dashboards(s), please check the exception traceback in the log
   Traceback (most recent call last):
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/cli.py", line 360, in import_dashboards
       ImportDashboardsCommand(contents, overwrite=True).run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 64, in run
       raise exc
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/dashboards/commands/importers/dispatcher.py", line 57, in run
       command.run()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 63, in run
       self.validate()
     File "/opt/superset/venv/lib/python3.7/site-packages/superset/commands/importers/v1/__init__.py", line 161, in validate
       raise exception
   superset.commands.exceptions.CommandInvalidError: Error importing dashboard
   double free or corruption (out)
   Aborted
   ```


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   need add this code 
   `
   for column in payload.get("columns", []):
       if column.get("extra"):
           try:
               column["extra"] = json.loads(column["extra"])
           except json.decoder.JSONDecodeError:
               logger.info("Unable to decode `extra` field: %s", column["extra"])
                       
   
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] srinisubramanian commented on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
srinisubramanian commented on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1076325335


   See issue #19297 @melnikovmaksimv  can you please delete the dataset/database and then try import again?  Continues to fail


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   
   `@staticmethod
       def _export(model: SqlaTable) -> Iterator[Tuple[str, str]]:
           database_slug = secure_filename(model.database.database_name)
           dataset_slug = secure_filename(model.table_name)
           file_name = f"datasets/{database_slug}/{dataset_slug}.yaml"
   
           payload = model.export_to_dict(
               recursive=True,
               include_parent_ref=False,
               include_defaults=True,
               export_uuids=True,
           )
           # TODO (betodealmeida): move this logic to export_to_dict once this
           # becomes the default export endpoint
           for key in JSON_KEYS:
               if payload.get(key):
                   try:
                       payload[key] = json.loads(payload[key])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `%s` field: %s", key, payload[key])
   
           for column in payload.get("columns", []):
               if column.get("extra"):
                   try:
                       column["extra"] = json.loads(column["extra"])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `extra` field: %s", column["extra"])
                       
           for metric in payload.get("metrics", []):
               if metric.get("extra"):
                   try:
                       metric["extra"] = json.loads(metric["extra"])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `extra` field: %s", metric["extra"])
   
           payload["version"] = EXPORT_VERSION
           payload["database_uuid"] = str(model.database.uuid)
   
           file_content = yaml.safe_dump(payload, sort_keys=False)
           yield file_name, file_content
   
           # include database as well
           file_name = f"databases/{database_slug}.yaml"
   
           payload = model.database.export_to_dict(
               recursive=False,
               include_parent_ref=False,
               include_defaults=True,
               export_uuids=True,
           )
           # TODO (betodealmeida): move this logic to export_to_dict once this
           # becomes the default export endpoint
           if payload.get("extra"):
               try:
                   payload["extra"] = json.loads(payload["extra"])
               except json.decoder.JSONDecodeError:
                   logger.info("Unable to decode `extra` field: %s", payload["extra"])
   
           payload["version"] = EXPORT_VERSION
   
           file_content = yaml.safe_dump(payload, sort_keys=False)
           yield file_name, file_content
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   need add this code 
   `
   for column in payload.get("columns", []):
       if column.get("extra"):
           try:
               column["extra"] = json.loads(column["extra"])
           except json.decoder.JSONDecodeError:
               logger.info("Unable to decode extra field: %s", column["extra"])
                       
   
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] srinisubramanian commented on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
srinisubramanian commented on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1075066388


   > @betodealmeida i find where bug and fix it superset\datasets\commands\export.py need add this code
   > 
   > `for column in payload.get("columns", []): if column.get("extra"): try: column["extra"] = json.loads(column["extra"]) except json.decoder.JSONDecodeError: logger.info("Unable to decode extra field: %s", column["extra"])`
   
   @melnikovmaksimv can you provide context on line number . function where this code has to be intriduced?  looks like i am facing the same issue


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   need add this code 
   
   `
   for column in payload.get("columns", []):
       if column.get("extra"):
           try:
               column["extra"] = json.loads(column["extra"])
           except json.decoder.JSONDecodeError:
               logger.info("Unable to decode extra field: %s", column["extra"])
   `
   `
                       
   
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] betodealmeida commented on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
betodealmeida commented on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1069490977


   Ah, thanks for the report, @EBoisseauSierra! I'll take a look.


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] srinisubramanian removed a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
srinisubramanian removed a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1075066388


   > @betodealmeida i find where bug and fix it superset\datasets\commands\export.py need add this code
   > 
   > `for column in payload.get("columns", []): if column.get("extra"): try: column["extra"] = json.loads(column["extra"]) except json.decoder.JSONDecodeError: logger.info("Unable to decode extra field: %s", column["extra"])`
   
   @melnikovmaksimv can you provide context on line number . function where this code has to be intriduced?  looks like i am facing the same issue


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv commented on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv commented on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   
   `
    @staticmethod
       def _export(model: SqlaTable) -> Iterator[Tuple[str, str]]:
           database_slug = secure_filename(model.database.database_name)
           dataset_slug = secure_filename(model.table_name)
           file_name = f"datasets/{database_slug}/{dataset_slug}.yaml"
   
           payload = model.export_to_dict(
               recursive=True,
               include_parent_ref=False,
               include_defaults=True,
               export_uuids=True,
           )
           # TODO (betodealmeida): move this logic to export_to_dict once this
           # becomes the default export endpoint
           for key in JSON_KEYS:
               if payload.get(key):
                   try:
                       payload[key] = json.loads(payload[key])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `%s` field: %s", key, payload[key])
   
           for column in payload.get("columns", []):
               if column.get("extra"):
                   try:
                       column["extra"] = json.loads(column["extra"])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `extra` field: %s", column["extra"])
                       
           for metric in payload.get("metrics", []):
               if metric.get("extra"):
                   try:
                       metric["extra"] = json.loads(metric["extra"])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `extra` field: %s", metric["extra"])
   
           payload["version"] = EXPORT_VERSION
           payload["database_uuid"] = str(model.database.uuid)
   
           file_content = yaml.safe_dump(payload, sort_keys=False)
           yield file_name, file_content
   
           # include database as well
           file_name = f"databases/{database_slug}.yaml"
   
           payload = model.database.export_to_dict(
               recursive=False,
               include_parent_ref=False,
               include_defaults=True,
               export_uuids=True,
           )
           # TODO (betodealmeida): move this logic to export_to_dict once this
           # becomes the default export endpoint
           if payload.get("extra"):
               try:
                   payload["extra"] = json.loads(payload["extra"])
               except json.decoder.JSONDecodeError:
                   logger.info("Unable to decode `extra` field: %s", payload["extra"])
   
           payload["version"] = EXPORT_VERSION
   
           file_content = yaml.safe_dump(payload, sort_keys=False)
           yield file_name, file_content
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   need add this code 
   `
           for column in payload.get("columns", []):
               if column.get("extra"):
                   try:
                       column["extra"] = json.loads(column["extra"])
                   except json.decoder.JSONDecodeError:
                       logger.info("Unable to decode `extra` field: %s", column["extra"])
                       
   
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] melnikovmaksimv edited a comment on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
melnikovmaksimv edited a comment on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1070383127


   @betodealmeida i find where bug and fix it
   superset\datasets\commands\export.py
   need add this code 
   
   `
   for column in payload.get("columns", []):
       if column.get("extra"):
           try:
               column["extra"] = json.loads(column["extra"])
           except json.decoder.JSONDecodeError:
               logger.info("Unable to decode extra field: %s", column["extra"])
   `


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on issue #19103: CLI import fails when a dataset column has empty `extra` specified

Posted by GitBox <gi...@apache.org>.
rusackas commented on issue #19103:
URL: https://github.com/apache/superset/issues/19103#issuecomment-1069337185


   cc @betodealmeida @eschutho who have a fair bit of context here.


-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org