Skip to content

SFTP x Excel cannot be tapped #90

Description

@ElmoreV

The tap as is, cannot correctly extract an Excel file from an SFTP server when connecting using a password.

I have found three issues in connecting to SFTP and tap an excel file, where two are fixed by PR #86 and the third is using a password in the uri as sftp://name:password@host:port//path/to/

At first connecting to the SFTP server and finding the file works as intended. The consequent streamreader then forgets that this is the intended route. A patch that works for me would be to add this in file format_hanlder.py in get_streamreader(uri,...):

def get_streamreader(uri, universal_newlines=True, newline='', open_mode='r', encoding='utf-8'):
    kwarg_dispatch = {
        "azure": lambda: {
            "transport_params": {
                "client": BlobServiceClient.from_connection_string(
                    os.environ['AZURE_STORAGE_CONNECTION_STRING'],
                )
            }
        },
        "sftp": lambda: {
            "transport_params": {
                   'connect_kwargs':{'look_for_keys':False}

            }
        }
    }

but this seems to prevent a correct handling whenever keys are actually present and look_for_keys needs to be True.

Note: it might be due to keyfiles already existing in the /.ssh/ folder, and failing before the authentication using the password is never correctly checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions