Skip to content

Commit

Permalink
remove unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sharinetmc committed Sep 12, 2023
1 parent 6d5ada6 commit 3a815c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions parsons/aws/s3.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import re
import boto3
from botocore.client import ClientError

# from parsons.databases.redshift.redshift import Redshift
from parsons.utilities import files
import logging
import os
import random
import datetime

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -474,6 +473,6 @@ def get_buckets_with_subname(self, bucket_subname):
"""

all_buckets = self.list_buckets()
buckets = [x for x in all_buckets if bucket_subname in x.split('-')]
buckets = [x for x in all_buckets if bucket_subname in x.split("-")]

return buckets
6 changes: 4 additions & 2 deletions test/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setUp(self):
self.tbl_2 = Table([{"first": "Jack", "last": "Smith"}])
csv_path_2 = self.tbl_2.to_csv()

self.test_bucket_subname = self.test_bucket.split('-')[0]
self.test_bucket_subname = self.test_bucket.split("-")[0]

# Sometimes it runs into issues putting the file
retry = 1
Expand Down Expand Up @@ -195,5 +195,7 @@ def test_get_buckets_with_subname(self):
buckets_with_subname_true = self.s3.get_buckets_type(self.test_bucket_subname)
self.assertTrue(self.test_bucket in buckets_with_subname_true)

buckets_with_subname_false = self.s3.get_buckets_type('bucketsubnamedoesnotexist')
buckets_with_subname_false = self.s3.get_buckets_type(
"bucketsubnamedoesnotexist"
)
self.assertFalse(self.test_bucket in buckets_with_subname_false)

0 comments on commit 3a815c3

Please sign in to comment.