Skip to content

Commit

Permalink
Update v2 upload interaction to match late-breaking changes (#67)
Browse files Browse the repository at this point in the history
* Incorporate latest changes to v2 upload interface

* lint fixes
  • Loading branch information
ChrisLoer authored May 23, 2024
1 parent e94c238 commit cb54f3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
4 changes: 1 addition & 3 deletions felt/core/map_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,7 @@ def _upload_progress(sent, total):
if self.isCanceled():
return False

layer_id = upload_details.get('data', {}).get('attributes',
{}).get(
'first_layer_id')
layer_id = upload_details.get('layer_id')
if details.style and details.style.fsl is not None:
if not layer_id:
Logger.instance().log_error_json(
Expand Down
40 changes: 16 additions & 24 deletions felt/core/s3_upload_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,20 @@ def from_json(res: str) -> 'S3UploadParameters':
"""
return S3UploadParameters(
type=res.get('data', {}).get('type'),
aws_access_key_id=res.get('data', {}).get('attributes', {}).get(
'presigned_attributes', {}).get('AWSAccessKeyId'),
acl=res.get('data', {}).get('attributes', {}).get(
'presigned_attributes', {}).get('acl'),
key=res.get('data', {}).get('attributes', {}).get(
'presigned_attributes', {}).get('key'),
policy=res.get('data', {}).get('attributes', {}).get(
'presigned_attributes', {}).get('policy'),
signature=res.get('data', {}).get('attributes', {}).get(
'presigned_attributes', {}).get('signature'),
success_action_status=res.get('data', {}).get('attributes',
{}).get(
'presigned_attributes', {}).get('success_action_status'),
x_amz_meta_features_flags=res.get('data', {}).get('attributes',
{}).get(
'presigned_attributes', {}).get('x-amz-meta-feature-flags'),
x_amz_meta_file_count=res.get('data', {}).get('attributes',
{}).get(
'presigned_attributes', {}).get('x-amz-meta-file-count'),
x_amz_security_token=res.get('data', {}).get('attributes',
{}).get(
'presigned_attributes', {}).get('x-amz-security-token'),
url=res.get('data', {}).get('attributes', {}).get('url'),
layer_id=res.get('data', {}).get('attributes', {}).get('layer_id'),
aws_access_key_id=res.get('presigned_attributes', {}).get(
'AWSAccessKeyId'),
acl=res.get('presigned_attributes', {}).get('acl'),
key=res.get('presigned_attributes', {}).get('key'),
policy=res.get('presigned_attributes', {}).get('policy'),
signature=res.get('presigned_attributes', {}).get('signature'),
success_action_status=res.get('presigned_attributes', {}).get(
'success_action_status'),
x_amz_meta_features_flags=res.get('presigned_attributes', {}).get(
'x-amz-meta-feature-flags'),
x_amz_meta_file_count=res.get('presigned_attributes', {}).get(
'x-amz-meta-file-count'),
x_amz_security_token=res.get('presigned_attributes', {}).get(
'x-amz-security-token'),
url=res.get('url'),
layer_id=res.get('layer_id'),
)

0 comments on commit cb54f3a

Please sign in to comment.