Skip to content

Commit 032a368

Browse files
shuningcclaude
andauthored
HYBIM-853 Bug fix for openapi upgrade (#72)
* fix(HYBIM-853): update patch script and regenerate client with openapi-python-client 0.29.0 - Rewrite _LOOP_RE in patch_http_validation_error.py to match 0.29.0 from_dict shape (_detail pop before type annotation, if _detail is not UNSET wrapper, loop without or []) - Update _loop_replacement to emit list[...] | Unset style (no Union) - Regenerate all 1136 files under src/splunk_ao/resources/ with 0.29.0 (Google-style docstrings, from __future__ import annotations, response variable naming, union reordering) - Confirmed patch re-applied: isinstance(_detail, list) guard present in http_validation_error.py - Confirmed generator warnings unchanged vs 0.26.x baseline (spec-level issues only, out of scope) Co-Authored-By: Claude <noreply@anthropic.com> * Fixing version conflicts brought by openapi version update * Updating openapi.yml from main and regen resources --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 190108e commit 032a368

1,215 files changed

Lines changed: 28116 additions & 27099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/agent/startup-simulator-3000/test_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import os
88
import sys
9-
from importlib.metadata import version, PackageNotFoundError
9+
from importlib.metadata import PackageNotFoundError, version
1010

1111
from dotenv import load_dotenv
1212

src/splunk_ao/otel.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import json
24
import logging
35
import typing
@@ -50,7 +52,7 @@ class OTLPSpanExporter: # type: ignore[no-redef]
5052
def __init__(self, *args, **kwargs) -> NoReturn: # type: ignore[no-untyped-def]
5153
raise ImportError(INSTALL_ERR_MSG)
5254

53-
def export(self, spans: typing.Sequence[Any]) -> "Any":
55+
def export(self, spans: typing.Sequence[Any]) -> Any:
5456
raise ImportError(INSTALL_ERR_MSG)
5557

5658
class Span: # type: ignore[no-redef]
@@ -80,7 +82,7 @@ def get_tracer(
8082
instrumenting_library_version: str | None = None,
8183
schema_url: str | None = None,
8284
attributes: Any | None = None,
83-
) -> "Tracer": ...
85+
) -> Tracer: ...
8486

8587

8688
_TRACE_PROVIDER_CONTEXT_VAR: ContextVar[TracerProvider | None] = ContextVar("galileo_trace_provider", default=None)
@@ -144,7 +146,7 @@ def __init__(self, project: str | None = None, logstream: str | None = None, **k
144146

145147
super().__init__(endpoint=endpoint, headers=exporter_headers, **kwargs)
146148

147-
def export(self, spans: typing.Sequence[Any]) -> "Any":
149+
def export(self, spans: typing.Sequence[Any]) -> Any:
148150
"""Override export to set resource attributes from span attributes before serialization."""
149151
is_experiment = False
150152
for span in spans:

src/splunk_ao/resources/api/annotation_queue/create_annotation_queue_annotation_queues_post.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, Optional
33

44
import httpx
55

@@ -38,9 +38,7 @@ def _get_kwargs(*, body: CreateAnnotationQueueRequest) -> dict[str, Any]:
3838
return _kwargs
3939

4040

41-
def _parse_response(
42-
*, client: ApiClient, response: httpx.Response
43-
) -> Union[AnnotationQueueResponse, HTTPValidationError]:
41+
def _parse_response(*, client: ApiClient, response: httpx.Response) -> AnnotationQueueResponse | HTTPValidationError:
4442
if response.status_code == 200:
4543
response_200 = AnnotationQueueResponse.from_dict(response.json())
4644

@@ -71,7 +69,7 @@ def _parse_response(
7169

7270
def _build_response(
7371
*, client: ApiClient, response: httpx.Response
74-
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
72+
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
7573
return Response(
7674
status_code=HTTPStatus(response.status_code),
7775
content=response.content,
@@ -82,7 +80,7 @@ def _build_response(
8280

8381
def sync_detailed(
8482
*, client: ApiClient, body: CreateAnnotationQueueRequest
85-
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
83+
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
8684
"""Create Annotation Queue
8785
8886
Create an annotation queue at the organization level.
@@ -100,7 +98,7 @@ def sync_detailed(
10098
httpx.TimeoutException: If the request takes longer than Client.timeout.
10199
102100
Returns:
103-
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
101+
Response[AnnotationQueueResponse | HTTPValidationError]
104102
"""
105103

106104
kwargs = _get_kwargs(body=body)
@@ -112,7 +110,7 @@ def sync_detailed(
112110

113111
def sync(
114112
*, client: ApiClient, body: CreateAnnotationQueueRequest
115-
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
113+
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
116114
"""Create Annotation Queue
117115
118116
Create an annotation queue at the organization level.
@@ -130,15 +128,15 @@ def sync(
130128
httpx.TimeoutException: If the request takes longer than Client.timeout.
131129
132130
Returns:
133-
Union[AnnotationQueueResponse, HTTPValidationError]
131+
AnnotationQueueResponse | HTTPValidationError
134132
"""
135133

136134
return sync_detailed(client=client, body=body).parsed
137135

138136

139137
async def asyncio_detailed(
140138
*, client: ApiClient, body: CreateAnnotationQueueRequest
141-
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
139+
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
142140
"""Create Annotation Queue
143141
144142
Create an annotation queue at the organization level.
@@ -156,7 +154,7 @@ async def asyncio_detailed(
156154
httpx.TimeoutException: If the request takes longer than Client.timeout.
157155
158156
Returns:
159-
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
157+
Response[AnnotationQueueResponse | HTTPValidationError]
160158
"""
161159

162160
kwargs = _get_kwargs(body=body)
@@ -168,7 +166,7 @@ async def asyncio_detailed(
168166

169167
async def asyncio(
170168
*, client: ApiClient, body: CreateAnnotationQueueRequest
171-
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
169+
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
172170
"""Create Annotation Queue
173171
174172
Create an annotation queue at the organization level.
@@ -186,7 +184,7 @@ async def asyncio(
186184
httpx.TimeoutException: If the request takes longer than Client.timeout.
187185
188186
Returns:
189-
Union[AnnotationQueueResponse, HTTPValidationError]
187+
AnnotationQueueResponse | HTTPValidationError
190188
"""
191189

192190
return (await asyncio_detailed(client=client, body=body)).parsed

src/splunk_ao/resources/api/annotation_queue/create_queue_template_annotation_queues_queue_id_templates_post.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, Optional
33

44
import httpx
55

@@ -42,9 +42,7 @@ def _get_kwargs(queue_id: str, *, body: CreateQueueTemplateRequest) -> dict[str,
4242
return _kwargs
4343

4444

45-
def _parse_response(
46-
*, client: ApiClient, response: httpx.Response
47-
) -> Union[HTTPValidationError, list["AnnotationTemplateDB"]]:
45+
def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | list[AnnotationTemplateDB]:
4846
if response.status_code == 200:
4947
response_200 = []
5048
_response_200 = response.json()
@@ -80,7 +78,7 @@ def _parse_response(
8078

8179
def _build_response(
8280
*, client: ApiClient, response: httpx.Response
83-
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
81+
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
8482
return Response(
8583
status_code=HTTPStatus(response.status_code),
8684
content=response.content,
@@ -91,7 +89,7 @@ def _build_response(
9189

9290
def sync_detailed(
9391
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
94-
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
92+
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
9593
"""Create Queue Template
9694
9795
Create template(s) in an annotation queue.
@@ -113,7 +111,7 @@ def sync_detailed(
113111
httpx.TimeoutException: If the request takes longer than Client.timeout.
114112
115113
Returns:
116-
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
114+
Response[HTTPValidationError | list[AnnotationTemplateDB]]
117115
"""
118116

119117
kwargs = _get_kwargs(queue_id=queue_id, body=body)
@@ -125,7 +123,7 @@ def sync_detailed(
125123

126124
def sync(
127125
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
128-
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
126+
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
129127
"""Create Queue Template
130128
131129
Create template(s) in an annotation queue.
@@ -147,15 +145,15 @@ def sync(
147145
httpx.TimeoutException: If the request takes longer than Client.timeout.
148146
149147
Returns:
150-
Union[HTTPValidationError, list['AnnotationTemplateDB']]
148+
HTTPValidationError | list[AnnotationTemplateDB]
151149
"""
152150

153151
return sync_detailed(queue_id=queue_id, client=client, body=body).parsed
154152

155153

156154
async def asyncio_detailed(
157155
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
158-
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
156+
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
159157
"""Create Queue Template
160158
161159
Create template(s) in an annotation queue.
@@ -177,7 +175,7 @@ async def asyncio_detailed(
177175
httpx.TimeoutException: If the request takes longer than Client.timeout.
178176
179177
Returns:
180-
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
178+
Response[HTTPValidationError | list[AnnotationTemplateDB]]
181179
"""
182180

183181
kwargs = _get_kwargs(queue_id=queue_id, body=body)
@@ -189,7 +187,7 @@ async def asyncio_detailed(
189187

190188
async def asyncio(
191189
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
192-
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
190+
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
193191
"""Create Queue Template
194192
195193
Create template(s) in an annotation queue.
@@ -211,7 +209,7 @@ async def asyncio(
211209
httpx.TimeoutException: If the request takes longer than Client.timeout.
212210
213211
Returns:
214-
Union[HTTPValidationError, list['AnnotationTemplateDB']]
212+
HTTPValidationError | list[AnnotationTemplateDB]
215213
"""
216214

217215
return (await asyncio_detailed(queue_id=queue_id, client=client, body=body)).parsed

src/splunk_ao/resources/api/annotation_queue/delete_annotation_queue_annotation_queues_queue_id_delete.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, Optional
33

44
import httpx
55

@@ -36,7 +36,7 @@ def _get_kwargs(queue_id: str) -> dict[str, Any]:
3636
return _kwargs
3737

3838

39-
def _parse_response(*, client: ApiClient, response: httpx.Response) -> Union[Any, HTTPValidationError]:
39+
def _parse_response(*, client: ApiClient, response: httpx.Response) -> Any | HTTPValidationError:
4040
if response.status_code == 200:
4141
response_200 = response.json()
4242
return response_200
@@ -64,7 +64,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> Union[Any
6464
raise errors.UnexpectedStatus(response.status_code, response.content)
6565

6666

67-
def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
67+
def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Any | HTTPValidationError]:
6868
return Response(
6969
status_code=HTTPStatus(response.status_code),
7070
content=response.content,
@@ -73,7 +73,7 @@ def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[
7373
)
7474

7575

76-
def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
76+
def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
7777
"""Delete Annotation Queue
7878
7979
Delete an annotation queue.
@@ -86,7 +86,7 @@ def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HT
8686
httpx.TimeoutException: If the request takes longer than Client.timeout.
8787
8888
Returns:
89-
Response[Union[Any, HTTPValidationError]]
89+
Response[Any | HTTPValidationError]
9090
"""
9191

9292
kwargs = _get_kwargs(queue_id=queue_id)
@@ -96,7 +96,7 @@ def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HT
9696
return _build_response(client=client, response=response)
9797

9898

99-
def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
99+
def sync(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
100100
"""Delete Annotation Queue
101101
102102
Delete an annotation queue.
@@ -109,13 +109,13 @@ def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidat
109109
httpx.TimeoutException: If the request takes longer than Client.timeout.
110110
111111
Returns:
112-
Union[Any, HTTPValidationError]
112+
Any | HTTPValidationError
113113
"""
114114

115115
return sync_detailed(queue_id=queue_id, client=client).parsed
116116

117117

118-
async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
118+
async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
119119
"""Delete Annotation Queue
120120
121121
Delete an annotation queue.
@@ -128,7 +128,7 @@ async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Unio
128128
httpx.TimeoutException: If the request takes longer than Client.timeout.
129129
130130
Returns:
131-
Response[Union[Any, HTTPValidationError]]
131+
Response[Any | HTTPValidationError]
132132
"""
133133

134134
kwargs = _get_kwargs(queue_id=queue_id)
@@ -138,7 +138,7 @@ async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Unio
138138
return _build_response(client=client, response=response)
139139

140140

141-
async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
141+
async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
142142
"""Delete Annotation Queue
143143
144144
Delete an annotation queue.
@@ -151,7 +151,7 @@ async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HT
151151
httpx.TimeoutException: If the request takes longer than Client.timeout.
152152
153153
Returns:
154-
Union[Any, HTTPValidationError]
154+
Any | HTTPValidationError
155155
"""
156156

157157
return (await asyncio_detailed(queue_id=queue_id, client=client)).parsed

0 commit comments

Comments
 (0)