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

   ### Bug description
   
   The "Upload CSV to Database" feature for Trino is not working properly after 
the changes introduced in 
[#28192](https://github.com/apache/superset/pull/28192).
   
   This issue did not exist in version 4.0.2, where the feature was functioning 
correctly.
   
   ### Screenshots/recordings
   
   Go to the "Upload CSV to Database" feature in the Superset UI.
   Select Trino as the target database.
   Attempt to upload a CSV file.
   Observe the error or malfunction.
   
   
   ```
   If Table Already Exists: Fail
   
   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'
   
   
   If Table Already Exists: Replace
   
   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 85, in upload_to_s3
       bucket = s3.Bucket(bucket_path)
     File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 
922, in __getattr__
       raise AttributeError(
   AttributeError: 'S3' object has no attribute 'Bucket'```
   
   
   
   ### Superset version
   
   4.1.1
   
   ### Python version
   
   3.10
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   This functionality was working correctly in version 4.0.2.
   The regression seems to have been introduced with the changes in 
[#28192](https://github.com/apache/superset/pull/28192).
   
   I attempted to use the "Replace" setting as a workaround, but it also fails. 
   The issue appears to be caused by hive.py relying on an outdated version of 
boto3.
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to