Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4a7ba02
Fixed mypy using facade pattern on adapters level
IgorChvyrov-sm Oct 29, 2025
6bd5468
Updated type hints
IgorChvyrov-sm Oct 29, 2025
7a13813
Orkes clients refactoring example
IgorChvyrov-sm Oct 30, 2025
d8f63c6
Merge branch 'feature_mypy_support' into feature_migrate_adapters_to_…
IgorChvyrov-sm Oct 30, 2025
93f4e52
Rework OrkesBaseClient for sync and async clients to add deprecation …
IgorChvyrov-sm Oct 30, 2025
f3bf15e
Added model validation for Orkes client
IgorChvyrov-sm Oct 30, 2025
badbfe6
Refactored OrkesAuthorizationClient
IgorChvyrov-sm Oct 31, 2025
ea18efa
Refactored OrkesEvent and Integration clients
IgorChvyrov-sm Oct 31, 2025
5deda26
Refactored Orkes clients for async client
IgorChvyrov-sm Oct 31, 2025
40a9c81
Refactored Orkes clients for sync client
IgorChvyrov-sm Nov 3, 2025
fd96ecd
Synced async and sync clients
IgorChvyrov-sm Nov 3, 2025
1a81e32
Added kwargs for orkes clients methods
IgorChvyrov-sm Nov 4, 2025
a2a9597
Updated unit tests
IgorChvyrov-sm Nov 4, 2025
840c741
Added unit tests for async Orkes client
IgorChvyrov-sm Nov 4, 2025
4e7dbf2
Added unit tests for sync Orkes client
IgorChvyrov-sm Nov 4, 2025
3a0b364
Added integration tests
IgorChvyrov-sm Nov 4, 2025
0b8d6ac
Sorted imports
IgorChvyrov-sm Nov 4, 2025
fcff731
Tests refactoring
IgorChvyrov-sm Nov 4, 2025
74ee9fb
Removed fixed mypy ignores
IgorChvyrov-sm Nov 5, 2025
fbff565
Added docstrings for async client
IgorChvyrov-sm Nov 5, 2025
5b4b763
Added docstrings for sync client
IgorChvyrov-sm Nov 5, 2025
c8b10af
Refactored secret client
IgorChvyrov-sm Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ ignore = [
# too-many-return-statements
"PLR0911",
# flake8-type-checking (150 errors)
"TC"
"TC",
# PT013: Arguments starting with underscore in function definitions starting with `test_` (e.g., test_connectivity in event_resource_api.py)
"PT019"
]

[tool.ruff.lint.isort]
Expand Down Expand Up @@ -215,20 +217,10 @@ plugins = [
"pydantic.mypy"
]
disable_error_code = [
"no-redef",
"return-value",
"var-annotated",
"assignment",
"call-arg",
"arg-type",
"override",
"dict-item",
"index",
"operator",
"call-overload",
"misc",
"attr-defined",
"union-attr",
"name-defined",
]

Expand Down
133 changes: 132 additions & 1 deletion src/conductor/asyncio_client/adapters/api/admin_resource_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,135 @@
from __future__ import annotations

from typing import Annotated, Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr

from conductor.asyncio_client.adapters import ApiClient
from conductor.asyncio_client.adapters.models.task_adapter import TaskAdapter
from conductor.asyncio_client.adapters.utils import convert_list_to_adapter
from conductor.asyncio_client.http.api import AdminResourceApi


class AdminResourceApiAdapter(AdminResourceApi): ...
class AdminResourceApiAdapter:
"""Adapter for AdminResourceApi that converts between generated models and adapters."""

def __init__(self, api_client: ApiClient):
self._api = AdminResourceApi(api_client)

async def clear_task_execution_cache(
self,
task_def_name: StrictStr,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> None:
"""Clear the task execution cache"""
await self._api.clear_task_execution_cache(
task_def_name,
_request_timeout=_request_timeout,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

async def get_redis_usage(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> Dict[str, object]:
"""Get the Redis usage"""
return await self._api.get_redis_usage(
_request_timeout=_request_timeout,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

async def requeue_sweep(
self,
workflow_id: StrictStr,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> str:
"""Requeue sweep"""
return await self._api.requeue_sweep(
workflow_id,
_request_timeout=_request_timeout,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

async def verify_and_repair_workflow_consistency(
self,
workflow_id: StrictStr,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> str:
"""Verify and repair workflow consistency"""
return await self._api.verify_and_repair_workflow_consistency(
workflow_id,
_request_timeout=_request_timeout,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

async def view(
self,
tasktype: StrictStr,
start: Optional[StrictInt] = None,
count: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[TaskAdapter]:
"""View tasks"""
result = await self._api.view(
tasktype,
start,
count,
_request_timeout=_request_timeout,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)
return convert_list_to_adapter(result, TaskAdapter)
Loading