Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses a sane default for pysftp_conn_kwargs #1825

Merged
merged 1 commit into from
Aug 24, 2016
Merged

Conversation

daveFNbuck
Copy link
Contributor

Description

pysftp_conn_kwargs defaults to None, which causes a TypeError when passed
with ** for the kwargs of pysftp.connect. This fixes replaces None with {} when storing pysftp_conn_kwargs in the RemoteFileSystem.

Motivation and Context

I found that since updating to the latest luigi yesterday, my sftp tasks have stopped working. There would be an error like TypeError: type object argument after ** must be a mapping, not NoneType in the luigi ftp library. I traced it down to the default value for the new optional argument pysftp_conn_kwargs in RemoteFileSystem. By storing {} when None is passed, the error is fixed.

Have you tested this? If so, how?

I ran a previously failing job with this code and it succeeded.

pysftp_conn_kwargs defaults to None, which causes a TypeError when passed
with ** for the kwargs of pysftp.connect. This fixes that bug by replacing
None with {} when storing pysftp_conn_kwargs in the RemoteFileSystem
object.
@mention-bot
Copy link

@daveFNbuck, thanks for your PR! By analyzing the annotation information on this pull request, we identified @petergaultney, @dlstadther and @ajornetic3 to be potential reviewers

@petergaultney
Copy link
Contributor

eesh, that's embarrassing. good catch. +1.

I guess this is what you get for contributing code and never using the default.

@daveFNbuck
Copy link
Contributor Author

No worries, it was a pretty easy fix. Unfortunately, I think this made it into the 2.3.0 release, so we'll probably want to bump to 2.3.1. This can be a fairly costly bug, as google recently started requiring sftp for some ad-related uploads.

@petergaultney
Copy link
Contributor

correct me if I'm wrong, but I was looking at the tests today and it seemed like luigi doesn't have any tests in the suite for the SFTP component of RemoteTarget? I think I was looking at ftp_test and there were only FTP tests in there. That might be exacerbating the issue.

@Tarrasch
Copy link
Contributor

@daveFNbuck. Do you think I should merge this immediately and release 2.3.1?

@daveFNbuck
Copy link
Contributor Author

@Tarrasch I think so. Loss of sftp can be pretty critical.
@petergaultney agreed, we should add some sftp tests. I was just blindly using it until today :)

@Tarrasch Tarrasch merged commit 6861ee3 into spotify:master Aug 24, 2016
@daveFNbuck daveFNbuck deleted the fix_sftp branch June 2, 2017 00:00
This was referenced Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants