Skip to content

Commit fa9bf5e

Browse files
committed
Update generated code and integration tests
1 parent 9f68c56 commit fa9bf5e

4 files changed

Lines changed: 33 additions & 17 deletions

File tree

clients/aws-sdk-qbusiness/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[project]
44
name = "aws_sdk_qbusiness"
5-
version = "0.4.0"
5+
version = "0.6.0"
66
description = "aws_sdk_qbusiness client"
77
readme = "README.md"
88
requires-python = ">=3.12"
@@ -23,8 +23,8 @@ classifiers = [
2323
]
2424

2525
dependencies = [
26-
"smithy_aws_core[eventstream, json]~=0.5.0",
27-
"smithy_core~=0.4.0",
26+
"smithy_aws_core[eventstream, json]~=0.6.0",
27+
"smithy_core~=0.5.0",
2828
"smithy_http[awscrt]~=0.4.0"
2929
]
3030

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Code generated by smithy-python-codegen DO NOT EDIT.
22

3-
__version__: str = "0.4.0"
3+
__version__: str = "0.6.0"

clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11966,16 +11966,16 @@
1196611966
],
1196711967
)
1196811968

11969-
ATTRIBUTE_FILTER.members["notFilter"] = Schema.member(
11970-
id=ATTRIBUTE_FILTER.id.with_member("notFilter"), target=ATTRIBUTE_FILTER, index=2
11971-
)
11972-
1197311969
ATTRIBUTE_FILTER.members["orAllFilters"] = Schema.member(
1197411970
id=ATTRIBUTE_FILTER.id.with_member("orAllFilters"),
1197511971
target=ATTRIBUTE_FILTERS,
1197611972
index=1,
1197711973
)
1197811974

11975+
ATTRIBUTE_FILTER.members["notFilter"] = Schema.member(
11976+
id=ATTRIBUTE_FILTER.id.with_member("notFilter"), target=ATTRIBUTE_FILTER, index=2
11977+
)
11978+
1197911979
ATTRIBUTE_FILTER.members["andAllFilters"] = Schema.member(
1198011980
id=ATTRIBUTE_FILTER.id.with_member("andAllFilters"),
1198111981
target=ATTRIBUTE_FILTERS,

clients/aws-sdk-qbusiness/tests/integration/conftest.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717
from . import REGION
1818

19-
_UNIQUE_SUFFIX = uuid.uuid4().hex
20-
APP_NAME = f"smithy-python-integ-test-{_UNIQUE_SUFFIX}"
21-
INDEX_NAME = "integ-test-index"
22-
RETRIEVER_NAME = "integ-test-retriever"
19+
# Tags applied to all resources so orphaned resources from interrupted
20+
# test runs can be discovered and cleaned up.
21+
_TAGS = [{"key": "Purpose", "value": "IntegTest"}]
2322

2423
# Custom waiter configs for Q Business resources.
2524
# Q Business does not provide built-in boto3 waiters.
@@ -101,23 +100,32 @@
101100
_waiter_model = WaiterModel(_WAITER_CONFIG)
102101

103102

104-
def _create_qbusiness_app() -> str:
103+
def _create_qbusiness_app(app_name: str, index_name: str, retriever_name: str) -> str:
105104
"""Create a Q Business application with index and retriever.
106105
106+
Args:
107+
app_name: The name of the Q Business application to create.
108+
index_name: The name of the index to create.
109+
retriever_name: The name of the retriever to create.
110+
107111
Returns:
108112
The application ID.
109113
"""
110114
qbusiness = boto3.client("qbusiness", region_name=REGION)
111115

112116
# Create application
113-
resp = qbusiness.create_application(displayName=APP_NAME, identityType="ANONYMOUS")
117+
resp = qbusiness.create_application(
118+
displayName=app_name, identityType="ANONYMOUS", tags=_TAGS
119+
)
114120
app_id = resp["applicationId"]
115121
create_waiter_with_client("ApplicationActive", _waiter_model, qbusiness).wait(
116122
applicationId=app_id
117123
)
118124

119125
# Create index
120-
resp = qbusiness.create_index(applicationId=app_id, displayName=INDEX_NAME)
126+
resp = qbusiness.create_index(
127+
applicationId=app_id, displayName=index_name, tags=_TAGS
128+
)
121129
index_id = resp["indexId"]
122130
create_waiter_with_client("IndexActive", _waiter_model, qbusiness).wait(
123131
applicationId=app_id, indexId=index_id
@@ -126,9 +134,10 @@ def _create_qbusiness_app() -> str:
126134
# Create retriever
127135
resp = qbusiness.create_retriever(
128136
applicationId=app_id,
129-
displayName=RETRIEVER_NAME,
137+
displayName=retriever_name,
130138
type="NATIVE_INDEX",
131139
configuration={"nativeIndexConfiguration": {"indexId": index_id}},
140+
tags=_TAGS,
132141
)
133142
retriever_id = resp["retrieverId"]
134143
create_waiter_with_client("RetrieverActive", _waiter_model, qbusiness).wait(
@@ -141,6 +150,8 @@ def _create_qbusiness_app() -> str:
141150
def _delete_qbusiness_app(app_id: str | None) -> None:
142151
"""Delete a Q Business application.
143152
153+
Deleting the application cascades to its index and retriever.
154+
144155
Args:
145156
app_id: The application ID to delete, or None if creation failed.
146157
"""
@@ -153,9 +164,14 @@ def _delete_qbusiness_app(app_id: str | None) -> None:
153164
@pytest.fixture(scope="session")
154165
def qbusiness_app():
155166
"""Create a Q Business application for the test session and delete it after."""
167+
unique_suffix = uuid.uuid4().hex[:16]
168+
app_name = f"integ-test-qbusiness-app-{unique_suffix}"
169+
index_name = f"integ-test-qbusiness-index-{unique_suffix}"
170+
retriever_name = f"integ-test-qbusiness-retriever-{unique_suffix}"
171+
156172
app_id = None
157173
try:
158-
app_id = _create_qbusiness_app()
174+
app_id = _create_qbusiness_app(app_name, index_name, retriever_name)
159175
yield app_id
160176
finally:
161177
_delete_qbusiness_app(app_id)

0 commit comments

Comments
 (0)