Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion examples/agent/startup-simulator-3000/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import os
import sys
from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import PackageNotFoundError, version

from dotenv import load_dotenv

Expand Down
8 changes: 5 additions & 3 deletions src/splunk_ao/otel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json
import logging
import typing
Expand Down Expand Up @@ -50,7 +52,7 @@ class OTLPSpanExporter: # type: ignore[no-redef]
def __init__(self, *args, **kwargs) -> NoReturn: # type: ignore[no-untyped-def]
raise ImportError(INSTALL_ERR_MSG)

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

class Span: # type: ignore[no-redef]
Expand Down Expand Up @@ -80,7 +82,7 @@ def get_tracer(
instrumenting_library_version: str | None = None,
schema_url: str | None = None,
attributes: Any | None = None,
) -> "Tracer": ...
) -> Tracer: ...


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

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

def export(self, spans: typing.Sequence[Any]) -> "Any":
def export(self, spans: typing.Sequence[Any]) -> Any:
"""Override export to set resource attributes from span attributes before serialization."""
is_experiment = False
for span in spans:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

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


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

Expand Down Expand Up @@ -71,7 +69,7 @@ def _parse_response(

def _build_response(
*, client: ApiClient, response: httpx.Response
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -82,7 +80,7 @@ def _build_response(

def sync_detailed(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue
Create an annotation queue at the organization level.
Expand All @@ -100,7 +98,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
Response[AnnotationQueueResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(body=body)
Expand All @@ -112,7 +110,7 @@ def sync_detailed(

def sync(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue
Create an annotation queue at the organization level.
Expand All @@ -130,15 +128,15 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AnnotationQueueResponse, HTTPValidationError]
AnnotationQueueResponse | HTTPValidationError
"""

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


async def asyncio_detailed(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Response[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Response[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue
Create an annotation queue at the organization level.
Expand All @@ -156,7 +154,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[AnnotationQueueResponse, HTTPValidationError]]
Response[AnnotationQueueResponse | HTTPValidationError]
"""

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

async def asyncio(
*, client: ApiClient, body: CreateAnnotationQueueRequest
) -> Optional[Union[AnnotationQueueResponse, HTTPValidationError]]:
) -> Optional[AnnotationQueueResponse | HTTPValidationError]:
"""Create Annotation Queue
Create an annotation queue at the organization level.
Expand All @@ -186,7 +184,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AnnotationQueueResponse, HTTPValidationError]
AnnotationQueueResponse | HTTPValidationError
"""

return (await asyncio_detailed(client=client, body=body)).parsed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

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


def _parse_response(
*, client: ApiClient, response: httpx.Response
) -> Union[HTTPValidationError, list["AnnotationTemplateDB"]]:
def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | list[AnnotationTemplateDB]:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
Expand Down Expand Up @@ -80,7 +78,7 @@ def _parse_response(

def _build_response(
*, client: ApiClient, response: httpx.Response
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -91,7 +89,7 @@ def _build_response(

def sync_detailed(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -113,7 +111,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
Response[HTTPValidationError | list[AnnotationTemplateDB]]
"""

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

def sync(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -147,15 +145,15 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[HTTPValidationError, list['AnnotationTemplateDB']]
HTTPValidationError | list[AnnotationTemplateDB]
"""

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


async def asyncio_detailed(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Response[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Response[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -177,7 +175,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[HTTPValidationError, list['AnnotationTemplateDB']]]
Response[HTTPValidationError | list[AnnotationTemplateDB]]
"""

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

async def asyncio(
queue_id: str, *, client: ApiClient, body: CreateQueueTemplateRequest
) -> Optional[Union[HTTPValidationError, list["AnnotationTemplateDB"]]]:
) -> Optional[HTTPValidationError | list[AnnotationTemplateDB]]:
"""Create Queue Template

Create template(s) in an annotation queue.
Expand All @@ -211,7 +209,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[HTTPValidationError, list['AnnotationTemplateDB']]
HTTPValidationError | list[AnnotationTemplateDB]
"""

return (await asyncio_detailed(queue_id=queue_id, client=client, body=body)).parsed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union
from typing import Any, Optional

import httpx

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


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


def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Any | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -73,7 +73,7 @@ def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[
)


def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
"""Delete Annotation Queue
Delete an annotation queue.
Expand All @@ -86,7 +86,7 @@ def sync_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HT
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[Any, HTTPValidationError]]
Response[Any | HTTPValidationError]
"""

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


def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
def sync(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
"""Delete Annotation Queue
Delete an annotation queue.
Expand All @@ -109,13 +109,13 @@ def sync(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidat
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Any | HTTPValidationError
"""

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


async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Union[Any, HTTPValidationError]]:
async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Any | HTTPValidationError]:
"""Delete Annotation Queue
Delete an annotation queue.
Expand All @@ -128,7 +128,7 @@ async def asyncio_detailed(queue_id: str, *, client: ApiClient) -> Response[Unio
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[Any, HTTPValidationError]]
Response[Any | HTTPValidationError]
"""

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


async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HTTPValidationError]]:
async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Any | HTTPValidationError]:
"""Delete Annotation Queue
Delete an annotation queue.
Expand All @@ -151,7 +151,7 @@ async def asyncio(queue_id: str, *, client: ApiClient) -> Optional[Union[Any, HT
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Any | HTTPValidationError
"""

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