Skip to content

Commit c322ec2

Browse files
Merge pull request #404 from conductor-oss/feat/conductor-clients-alias
feat: add ConductorClients as alias for OrkesClients
2 parents 18198a1 + 432d4e3 commit c322ec2

4 files changed

Lines changed: 42 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Create a `quickstart.py` with the following:
106106
```python
107107
from conductor.client.automator.task_handler import TaskHandler
108108
from conductor.client.configuration.configuration import Configuration
109-
from conductor.client.orkes_clients import OrkesClients # works with OSS Conductor and Orkes Conductor
109+
from conductor.client.orkes_clients import ConductorClients # OrkesClients is an alias for the same class
110110
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
111111
from conductor.client.worker.worker_task import worker_task
112112

@@ -121,7 +121,7 @@ def main():
121121
# Configure the SDK (reads CONDUCTOR_SERVER_URL / CONDUCTOR_AUTH_* from env).
122122
config = Configuration()
123123

124-
clients = OrkesClients(configuration=config)
124+
clients = ConductorClients(configuration=config)
125125
executor = clients.get_workflow_executor()
126126

127127
# Build a workflow with the >> operator.
@@ -329,10 +329,10 @@ Full lifecycle control — start, execute, pause, resume, terminate, retry, rest
329329
```python
330330
from conductor.client.configuration.configuration import Configuration
331331
from conductor.client.http.models import StartWorkflowRequest, RerunWorkflowRequest, TaskResult
332-
from conductor.client.orkes_clients import OrkesClients
332+
from conductor.client.orkes_clients import ConductorClients
333333
334334
config = Configuration()
335-
clients = OrkesClients(configuration=config)
335+
clients = ConductorClients(configuration=config)
336336
workflow_client = clients.get_workflow_client()
337337
task_client = clients.get_task_client()
338338
executor = clients.get_workflow_executor()

src/conductor/client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from conductor.client.configuration.configuration import Configuration
44
from conductor.client.automator.task_handler import TaskHandler
55
from conductor.client.automator.task_runner import TaskRunner
6-
from conductor.client.orkes_clients import OrkesClients
6+
from conductor.client.orkes_clients import OrkesClients, ConductorClients
77
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
88
from conductor.client.workflow.executor.workflow_executor import WorkflowExecutor
99
from conductor.client.worker.worker_task import worker_task
@@ -18,6 +18,7 @@
1818
"TaskHandler",
1919
"TaskRunner",
2020
"OrkesClients",
21+
"ConductorClients",
2122
"ConductorWorkflow",
2223
"WorkflowExecutor",
2324
"worker_task",

src/conductor/client/orkes_clients.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ def get_prompt_client(self) -> PromptClient:
5555

5656
def get_schema_client(self) -> SchemaClient:
5757
return OrkesSchemaClient(self.configuration)
58+
59+
60+
ConductorClients = OrkesClients
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from conductor.client.orkes_clients import OrkesClients, ConductorClients
2+
from conductor.client import ConductorClients as ConductorClientsFromPkg
3+
from conductor.client.configuration.configuration import Configuration
4+
5+
6+
def test_alias_is_same_class():
7+
assert ConductorClients is OrkesClients
8+
9+
10+
def test_package_export_is_same_class():
11+
assert ConductorClientsFromPkg is OrkesClients
12+
13+
14+
def test_conductor_clients_instantiates():
15+
config = Configuration(server_api_url='http://localhost:8080/api')
16+
clients = ConductorClients(configuration=config)
17+
assert isinstance(clients, OrkesClients)
18+
19+
20+
def test_conductor_clients_default_config():
21+
clients = ConductorClients()
22+
assert clients.configuration is not None
23+
24+
25+
def test_conductor_clients_get_methods():
26+
config = Configuration(server_api_url='http://localhost:8080/api')
27+
clients = ConductorClients(configuration=config)
28+
assert clients.get_workflow_executor() is not None
29+
assert clients.get_workflow_client() is not None
30+
assert clients.get_task_client() is not None
31+
assert clients.get_metadata_client() is not None
32+
assert clients.get_scheduler_client() is not None
33+
assert clients.get_secret_client() is not None

0 commit comments

Comments
 (0)