Skip to content

Commit

Permalink
Merge branch 'main' into fix/issue-2965-bool-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaidisido authored Oct 1, 2024
2 parents 69f05fc + 635f6d5 commit 7948327
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions awswrangler/data_api/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ def _create_value_dict( # noqa: PLR0911
if isinstance(value, Decimal):
return {"stringValue": str(value)}, "DECIMAL"

if isinstance(value, uuid.UUID):
return {"stringValue": str(value)}, "UUID"

raise exceptions.InvalidArgumentType(f"Value {value} not supported.")


Expand Down
1 change: 1 addition & 0 deletions test_infra/stacks/base_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs: str) -> None:
),
],
versioned=True,
enforce_ssl=True,
)
self.bucket_access_point = s3.CfnAccessPoint(
self,
Expand Down
1 change: 1 addition & 0 deletions test_infra/stacks/glueray_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(
"Script Bucket",
block_public_access=s3.BlockPublicAccess.BLOCK_ALL,
removal_policy=RemovalPolicy.DESTROY,
enforce_ssl=True,
)

self.athena_workgroup = athena.CfnWorkGroup(
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/test_data_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import uuid
from typing import Any, Iterator

import boto3
Expand Down Expand Up @@ -284,7 +285,8 @@ def test_data_api_mysql_ansi(mysql_serverless_connector: "RdsDataApi", mysql_ser

def test_data_api_postgresql(postgresql_serverless_connector: "RdsDataApi", postgresql_serverless_table: str) -> None:
database = "test"
frame = pd.DataFrame([[42, "test"]], columns=["id", "name"])
_id = uuid.uuid4()
frame = pd.DataFrame([[_id, "test"]], columns=["id", "name"])

wr.data_api.rds.to_sql(
df=frame,
Expand All @@ -295,7 +297,7 @@ def test_data_api_postgresql(postgresql_serverless_connector: "RdsDataApi", post
)

out_frame = wr.data_api.rds.read_sql_query(
f"SELECT name FROM {postgresql_serverless_table} WHERE id = 42", con=postgresql_serverless_connector
f"SELECT name FROM {postgresql_serverless_table} WHERE id = '{_id}'", con=postgresql_serverless_connector
)
expected_dataframe = pd.DataFrame([["test"]], columns=["name"])
assert_pandas_equals(out_frame, expected_dataframe)

0 comments on commit 7948327

Please sign in to comment.