john-bodley commented on a change in pull request #9734:
URL:
https://github.com/apache/incubator-superset/pull/9734#discussion_r428391053
##########
File path: superset/db_engine_specs/base.py
##########
@@ -454,55 +453,26 @@ def df_to_sql(cls, df: pd.DataFrame, **kwargs: Any) ->
None:
df.to_sql(**kwargs)
@classmethod
- def create_table_from_csv(cls, form: Form, database: "Database") -> None:
+ def create_table_from_csv( # pylint: disable=too-many-arguments
+ cls,
+ filename: str,
+ table: Table,
Review comment:
👍
##########
File path: superset/db_engine_specs/hive.py
##########
@@ -173,12 +158,13 @@ def convert_to_hive_type(col_type: str) -> str:
import boto3 # pylint: disable=import-error
s3 = boto3.client("s3")
- location = os.path.join("s3a://", bucket_path, upload_prefix,
table_name)
+ location = os.path.join("s3a://", bucket_path, upload_prefix,
table.table)
s3.upload_file(
filename,
bucket_path,
- os.path.join(upload_prefix, table_name,
os.path.basename(filename)),
+ os.path.join(upload_prefix, table.table,
os.path.basename(filename)),
)
+ # TODO(bkyryliuk): support other delimiters
Review comment:
It seems like `full_table_name` is only used once and thus I wonder if
we should annex line 137 and make line 168,
```python
sql = f"""CREATE TABLE {str(table)} (
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]