Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Create a `quickstart.py` with the following:
```python
from conductor.client.automator.task_handler import TaskHandler
from conductor.client.configuration.configuration import Configuration
from conductor.client.orkes_clients import OrkesClients # works with OSS Conductor and Orkes Conductor
from conductor.client.orkes_clients import ConductorClients # OrkesClients is an alias for the same class
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
from conductor.client.worker.worker_task import worker_task

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

clients = OrkesClients(configuration=config)
clients = ConductorClients(configuration=config)
executor = clients.get_workflow_executor()

# Build a workflow with the >> operator.
Expand Down Expand Up @@ -329,10 +329,10 @@ Full lifecycle control — start, execute, pause, resume, terminate, retry, rest
```python
from conductor.client.configuration.configuration import Configuration
from conductor.client.http.models import StartWorkflowRequest, RerunWorkflowRequest, TaskResult
from conductor.client.orkes_clients import OrkesClients
from conductor.client.orkes_clients import ConductorClients

config = Configuration()
clients = OrkesClients(configuration=config)
clients = ConductorClients(configuration=config)
workflow_client = clients.get_workflow_client()
task_client = clients.get_task_client()
executor = clients.get_workflow_executor()
Expand Down
3 changes: 2 additions & 1 deletion src/conductor/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from conductor.client.configuration.configuration import Configuration
from conductor.client.automator.task_handler import TaskHandler
from conductor.client.automator.task_runner import TaskRunner
from conductor.client.orkes_clients import OrkesClients
from conductor.client.orkes_clients import OrkesClients, ConductorClients
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
from conductor.client.workflow.executor.workflow_executor import WorkflowExecutor
from conductor.client.worker.worker_task import worker_task
Expand All @@ -18,6 +18,7 @@
"TaskHandler",
"TaskRunner",
"OrkesClients",
"ConductorClients",
"ConductorWorkflow",
"WorkflowExecutor",
"worker_task",
Expand Down
3 changes: 3 additions & 0 deletions src/conductor/client/orkes_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ def get_prompt_client(self) -> PromptClient:

def get_schema_client(self) -> SchemaClient:
return OrkesSchemaClient(self.configuration)


ConductorClients = OrkesClients
33 changes: 33 additions & 0 deletions tests/unit/test_conductor_clients.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from conductor.client.orkes_clients import OrkesClients, ConductorClients
from conductor.client import ConductorClients as ConductorClientsFromPkg
from conductor.client.configuration.configuration import Configuration


def test_alias_is_same_class():
assert ConductorClients is OrkesClients


def test_package_export_is_same_class():
assert ConductorClientsFromPkg is OrkesClients


def test_conductor_clients_instantiates():
config = Configuration(server_api_url='http://localhost:8080/api')
clients = ConductorClients(configuration=config)
assert isinstance(clients, OrkesClients)


def test_conductor_clients_default_config():
clients = ConductorClients()
assert clients.configuration is not None


def test_conductor_clients_get_methods():
config = Configuration(server_api_url='http://localhost:8080/api')
clients = ConductorClients(configuration=config)
assert clients.get_workflow_executor() is not None
assert clients.get_workflow_client() is not None
assert clients.get_task_client() is not None
assert clients.get_metadata_client() is not None
assert clients.get_scheduler_client() is not None
assert clients.get_secret_client() is not None
Loading