Replies: 5 comments 2 replies
-
Hey there, @abhs50! I'm here to help you with any bugs, questions, or contributions you might have. Let's tackle this together! The Trino connection failure when uploading a CSV in Superset 4.1.0rc2 is due to an A similar issue was discussed in a closed thread, where the suggested solution was to use the |
Beta Was this translation helpful? Give feedback.
-
@dosu : This might be due to Trino not supporting database.has_table_by_name(table.table, table.schema) even in the latest version trino-0.330.0 |
Beta Was this translation helpful? Give feedback.
-
We might use 'replace' instead of 'fail' strategy. if to_sql_kwargs["if_exists"] == "fail":
if database.has_table_by_name(table.table, table.schema):
raise SupersetException("Table already exists")
elif to_sql_kwargs["if_exists"] == "replace":
with cls.get_engine(database) as engine:
engine.execute(f"DROP TABLE IF EXISTS {str(table)}") |
Beta Was this translation helpful? Give feedback.
-
After then I got this error message Traceback (most recent call last):
File "/app/superset/commands/database/uploaders/base.py", line 114, in _dataframe_to_database
database.db_engine_spec.df_to_sql(
File "/app/superset/db_engine_specs/trino.py", line 546, in df_to_sql
location=upload_to_s3(
File "/app/superset/db_engine_specs/hive.py", line 77, in upload_to_s3
raise Exception( # pylint: disable=broad-exception-raised
Exception: No upload bucket specified. You can specify one in the config file. |
Beta Was this translation helpful? Give feedback.
-
I just created a bug issue related to this: #31784. Please take a look. Even after adding the relevant config to config.py, it doesn't work due to the boto3 version issue. This functionality worked perfectly in version 4.0.2, but I'm in a situation where rolling back is difficult. It's quite frustrating... |
Beta Was this translation helpful? Give feedback.
-
`WARNING:superset.views.error_handling:CommandException
Traceback (most recent call last):
File "/app/superset/commands/database/uploaders/base.py", line 114, in _dataframe_to_database
database.db_engine_spec.df_to_sql(
File "/app/superset/db_engine_specs/trino.py", line 515, in df_to_sql
if database.has_table_by_name(table.table, table.schema):
AttributeError: 'Database' object has no attribute 'has_table_by_name'
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/databases/api.py", line 1727, in csv_upload
).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/database/uploaders/base.py", line 154, in run
self._reader.read(self._file, self._model, self._table_name, self._schema)
File "/app/superset/commands/database/uploaders/base.py", line 86, in read
self._dataframe_to_database(
File "/app/superset/commands/database/uploaders/base.py", line 129, in _dataframe_to_database
raise DatabaseUploadFailed(exception=ex) from ex
superset.commands.database.exceptions.DatabaseUploadFailed: Database upload file failed`
Beta Was this translation helpful? Give feedback.
All reactions