Skip to content

Commit

Permalink
Merge pull request #114 from nrccua/DS-457-add-sqs-region-assigning-i…
Browse files Browse the repository at this point in the history
…n-longrunningjobs

Add sqs.sync_add_regions
  • Loading branch information
nrccua-timr authored Nov 16, 2023
2 parents 5a9347b + 372d500 commit d0c19f9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ History
=======


v0.20.1 (2023-11-16)

* Add sqs.sync_add_regions for setting region besides us-east-1 during instantiation of LongRunningJobs.


v0.20.0 (2023-11-06)

* Update redis==5.0.1.
Expand Down
10 changes: 10 additions & 0 deletions aioradio/aws/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ async def add_regions(regions: List[str]):
AWS_SERVICE.add_regions(regions)


def sync_add_regions(regions: List[str]):
"""Add regions to SQS AWS service.
Args:
regions (List[str]): List of AWS regions
"""

AWS_SERVICE.add_regions(regions)


@AWS_SERVICE.active
async def create_queue(queue: str, region: str, attributes: Dict[str, str], account_id: str='') -> Dict[str, Any]:
"""Create SQS queue in region defined.
Expand Down
1 change: 1 addition & 0 deletions aioradio/long_running_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LongRunningJobs:
# define the queue name and aws region
sqs_queue: str = None
sqs_region: str = None
sqs.sync_add_regions([sqs_region])

# If running test cases use fakeredis
fakeredis: bool = False
Expand Down
4 changes: 2 additions & 2 deletions aioradio/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ mandrill==1.0.60
moto==3.1.18
openpyxl==3.0.10
orjson==3.8.10
pandas==2.1.2
polars==0.19.12
pandas==2.1.3
polars==0.19.13
pre-commit==3.5.0
psycopg2-binary==2.9.9
pyarrow==13.0.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.20.0',
version='0.20.1',
description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit d0c19f9

Please sign in to comment.