-
Notifications
You must be signed in to change notification settings - Fork 88
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
Functionality to create storage buckets in GCP and AWS #291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
+ Coverage 65.39% 65.66% +0.26%
==========================================
Files 14 32 +18
Lines 968 2222 +1254
==========================================
+ Hits 633 1459 +826
- Misses 335 763 +428
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Not sure what's up with this current linting error ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits, otherwise LGTM
ACL=acl, | ||
CreateBucketConfiguration={ | ||
'LocationConstraint': region or self.aws_account.default_region | ||
}) # type: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateBucketConfiguration={ # type: Dict[str, Any]
'LocationConstraint': region or self.aws_account.default_region
})
Should fix the mypy problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
self, | ||
name: str, | ||
region: Optional[str] = None, | ||
acl: Optional[str] = 'private') -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Optional
type hint can be removed here since it's assigned a default value.
In general, for named parameters that default to None
, we use the Optional
type hint. All other cases, we don't.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl # pylint: disable=line-too-long | ||
|
||
Returns: | ||
Dict: An API operation object an S3 bucket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo/missing word(s) in the sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gcs_path: str, | ||
user_project: Optional[str] = None) -> Dict[str, Any]: | ||
def GetObjectMetadata( | ||
self, gcs_path: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line after self
param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -98,8 +98,7 @@ def GetObjectMetadata(self, | |||
response = request.execute() # type: Dict[str, Any] | |||
return response | |||
|
|||
def GetBucketACLs(self, | |||
bucket: str, | |||
def GetBucketACLs(self, bucket: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line after self
param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
self, | ||
bucket: str, | ||
labels: Optional[Dict[str, str]] = None, | ||
predefinedacl: Optional[str] = 'private', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above for the use of Optional
Same below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
self, | ||
name: str, | ||
region: Optional[str] = None, | ||
acl: Optional[str] = 'private') -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl # pylint: disable=line-too-long | ||
|
||
Returns: | ||
Dict: An API operation object an S3 bucket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ACL=acl, | ||
CreateBucketConfiguration={ | ||
'LocationConstraint': region or self.aws_account.default_region | ||
}) # type: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
gcs_path: str, | ||
user_project: Optional[str] = None) -> Dict[str, Any]: | ||
def GetObjectMetadata( | ||
self, gcs_path: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -98,8 +98,7 @@ def GetObjectMetadata(self, | |||
response = request.execute() # type: Dict[str, Any] | |||
return response | |||
|
|||
def GetBucketACLs(self, | |||
bucket: str, | |||
def GetBucketACLs(self, bucket: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
self, | ||
bucket: str, | ||
labels: Optional[Dict[str, str]] = None, | ||
predefinedacl: Optional[str] = 'private', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
:( still the mypy error, @giovannt0 |
@Fryyyyy this works locally:
|
As part of the work for #135 - first we need to be able to create buckets.