Skip to content

Commit 24c7bd1

Browse files
committed
Merge branch 'develop' v0.3.1
2 parents 00b43b6 + c4fae49 commit 24c7bd1

File tree

7 files changed

+382
-787
lines changed

7 files changed

+382
-787
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.1] - 2022-08-23
8+
### Fixed
9+
- Support nested folders in bulk workflow
10+
711
## [0.3.0] - 2022-08-12
812
### Added
913
- Initial processing for Genesys CTR telephony files. See [Integration with Telephony CTR Files](./README.md#integration-with-telephony-ctr-files)
@@ -64,7 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6468
### Added
6569
- Initial release
6670

67-
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.3.0...develop
71+
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.3.1...develop
72+
[0.3.1]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.3.1
6873
[0.3.0]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.3.0
6974
[0.2.5]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.2.5
7075
[0.2.4]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.2.4

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.3.1

pca-main-nokendra.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AWSTemplateFormatVersion: "2010-09-09"
22

3-
Description: Amazon Transcribe Post Call Analytics - PCA (v0.3.0) (uksb-1sn29lk73)
3+
Description: Amazon Transcribe Post Call Analytics - PCA (v0.3.1) (uksb-1sn29lk73)
44

55
Parameters:
66

pca-main.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AWSTemplateFormatVersion: "2010-09-09"
22

3-
Description: Amazon Transcribe Post Call Analytics - PCA (v0.3.0) (uksb-1sn29lk73)
3+
Description: Amazon Transcribe Post Call Analytics - PCA (v0.3.1) (uksb-1sn29lk73)
44

55
Parameters:
66

pca-server/src/pca/pca-aws-sf-bulk-files-count.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import copy
1212
import boto3
1313

14-
1514
def lambda_handler(event, context):
1615

1716
# Get our params, looking them up if we haven't got them
@@ -39,9 +38,11 @@ def lambda_handler(event, context):
3938

4039
# Just get a single S3 check on whether or not we have files to go
4140
s3Client = boto3.client('s3')
42-
response = s3Client.list_objects_v2(Bucket=bucket, MaxKeys=dripRate)
41+
maxKeys = dripRate + 10 # list a few additional keys to allow for some folder objects that won't be moved
42+
response = s3Client.list_objects_v2(Bucket=bucket, MaxKeys=maxKeys)
4343
if "Contents" in response:
44-
filesFound = len(response["Contents"])
44+
files = [f for f in response["Contents"] if not f["Key"].endswith("/")][:dripRate] # ignore folder objects
45+
filesFound = len(files)
4546
else:
4647
filesFound = 0
4748
sfData["filesToMove"] = filesFound

pca-server/src/pca/pca-aws-sf-bulk-move-files.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ def lambda_handler(event, context):
2424

2525
# Get as many files from S3 as we can move this time (minimum of queueSpace and dripRate)
2626
s3Client = boto3.client('s3')
27-
response = s3Client.list_objects_v2(Bucket=sourceBucket, MaxKeys=(min(dripRate, queueSpace)))
27+
maxKeys = min(dripRate, queueSpace) + 10 # list a few additional keys to allow for some folder objects that won't be moved
28+
response = s3Client.list_objects_v2(Bucket=sourceBucket, MaxKeys=maxKeys)
2829
if "Contents" in response:
2930
# We now have a list of objects that we can use
3031
sourcePrefix = "/" + sourceBucket + "/"
3132
keyPrefix = targetAudioKey
3233
if keyPrefix != "":
3334
keyPrefix += "/"
34-
for audioFile in response["Contents"]:
35+
files = [f for f in response["Contents"] if not f["Key"].endswith("/")][:dripRate] # ignore folder objects
36+
for audioFile in files:
3537
try:
3638
# Copy and delete file
39+
print(f'Copying: Bucket={targetBucket}, CopySource={(sourcePrefix + audioFile["Key"])}, Key={(keyPrefix + audioFile["Key"])}')
3740
copyResponse = s3Client.copy_object(Bucket=targetBucket,
3841
CopySource=(sourcePrefix + audioFile["Key"]),
3942
Key=(keyPrefix + audioFile["Key"]))
@@ -58,5 +61,5 @@ def lambda_handler(event, context):
5861
"dripRate": 50,
5962
"filesProcessed": 0,
6063
"queueSpace": 250
61-
}
64+
}
6265
lambda_handler(event, "")

0 commit comments

Comments
 (0)