ktravis commented on issue #4285: Import CSV File Into PosgreSQL Table. Error: 
password authentication failed
URL: 
https://github.com/apache/incubator-superset/issues/4285#issuecomment-370867065
 
 
   I was experiencing the same issue and did some digging. It seems that as of 
#4298, the call to `create_engine` within `create_table_from_csv` [located 
here](https://github.com/apache/incubator-superset/blob/master/superset/db_engine_specs.py#L138)
 is using `sqlalchemy_uri` to create a new SQLAlchemy engine. This works as 
expected if the URI does not contain a password - however if it does, this 
string contains the *masked* password (i.e. `XXXXXXXX`), and authentication is 
attempted using that instead. Changing the line to use 
`sqlalchemy_uri_decrypted` instead sends the actual password, resolving the 
issue. 
   
   For example:
   ```python
           # File "superset/db_engine_specs.py", line ~134
           # ...
           df_to_db_kwargs = {
               'table': table,
               'df': df,
               'name': form.name.data,
               'con': create_engine(form.con.data.sqlalchemy_uri_decrypted, 
echo=False),
               'schema': form.schema.data,
               'if_exists': form.if_exists.data,
               'index': form.index.data,
               'index_label': form.index_label.data,
               'chunksize': 10000,
           }
           # ...
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to