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

Load CSV through S3File() Doesn't Work in Python 3 #59

Open
diver55 opened this issue Jul 12, 2018 · 0 comments
Open

Load CSV through S3File() Doesn't Work in Python 3 #59

diver55 opened this issue Jul 12, 2018 · 0 comments

Comments

@diver55
Copy link

diver55 commented Jul 12, 2018

Thanks who contributed to this package. It helps.

When I test it using LoadFile(filename), it works.
But when I test it using S3FILE like below, it doesn't work. I'm using Python 3.
test = YourFirstValidator(S3File(path = None, bucket='buckets', key='key/file.csv'))

I installed package via "pip install vladiate"
But I found the code I downloaded is different with the code in github.
I downloaded this version "vladiate-0.0.20.dist-info".

I investigate the failures I faced. Found out the inputs.py in this version need an update.
I believe the issue was, the LoadFile returns list, but S3File returns str. So I added one line in bold below to make code works.

under class S3File(VladInput):
...
ret=obj.get()['Body'].read().decode('utf-8')
**Convert str to list
ret = ret.splitlines()
...

I'm not a expert programmer. Not 100% sure this can fix all potential issues. But it do resolve my issue. I hope this can help to other people who faced same issue.

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

No branches or pull requests

1 participant