From 9eb46954cd409c1feb06e89558329888386cd3a5 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 4 Nov 2020 14:26:46 -0600 Subject: [PATCH] bug fixes: mongodb and s3 bucket --- setup.py | 2 +- transport/mongo.py | 2 +- transport/s3.py | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 1d628d4..46719ba 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() args = { "name":"data-transport", - "version":"1.2.4", + "version":"1.2.6", "author":"The Phi Technology LLC","author_email":"info@the-phi.com", "license":"MIT", "packages":["transport"]} diff --git a/transport/mongo.py b/transport/mongo.py index 04e2cad..e0e024d 100644 --- a/transport/mongo.py +++ b/transport/mongo.py @@ -71,7 +71,7 @@ class MongoReader(Mongo,Reader): key = 'n' if 'cursor' in out and out['cursor'][key] : r += list(out['cursor'][key]) - elif out[key]: + elif key in out and out[key]: r.append (out[key]) # yield out['cursor'][key] if key not in ['firstBatch','nextBatch'] or ('cursor' in out and out['cursor']['id'] == 0) : diff --git a/transport/s3.py b/transport/s3.py index 1a67317..6c26dd3 100644 --- a/transport/s3.py +++ b/transport/s3.py @@ -128,8 +128,3 @@ class s3Writer(s3,Writer) : self.s3.upload_fileobj(file,self.bucket_name,self.filename) pass -if __name__ == '__main__' : - p = {'access_key':'AKIAJO7KII27XH3TCPJQ','secret_key':'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'} - reader = s3Reader(**p) - buckets = reader.buckets() - print(reader.list(name = buckets[0]))