Skip to content

Commit

Permalink
Merge pull request #9 from oncase/feat/add_new_aws_services
Browse files Browse the repository at this point in the history
DynamoDB resource bug fixed
  • Loading branch information
guimorone authored Apr 6, 2023
2 parents 0bd9f18 + 6f9eca3 commit c354b9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
uses: marvinpinto/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
title: 'v1.1.2 Ldap module added'
title: 'v1.1.3 DynamoDB resource bug fixed'
prerelease: false
automatic_release_tag: v1.1.2
automatic_release_tag: v1.1.3
files: |
LICENSE
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyscora-wrangler"
version = "1.1.2"
version = "1.1.3"
description = "Python lib for DE"
authors = ["Oncase <[email protected]>"]
maintainers = ["Guilherme Morone <[email protected]>"]
Expand Down
8 changes: 4 additions & 4 deletions pyscora_wrangler/aws/dynamodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ def get_data_by_key(
"""

session = get_boto3_session(boto3_session)
client = session.client(DYNAMODB_SERVICE_NAME)
resource = session.resource(DYNAMODB_SERVICE_NAME)

data = None

dynamo_table = client.Table(table_name)
dynamo_table = resource.Table(table_name)
response = dynamo_table.query(KeyConditionExpression=Key(key).eq(value))
response = response.get("Items", [])

Expand Down Expand Up @@ -167,9 +167,9 @@ def put_item(
"""

session = get_boto3_session(boto3_session)
client = session.client(DYNAMODB_SERVICE_NAME)
resource = session.resource(DYNAMODB_SERVICE_NAME)

table = client.Table(table_name)
table = resource.Table(table_name)
encoded_data = get_data_encoded(data) if encode_data else data
item = table.put_item(Item=encoded_data, *dynamodb_additional_args, **dynamodb_additional_kwargs)

Expand Down

0 comments on commit c354b9a

Please sign in to comment.