Skip to content

Commit e07ce03

Browse files
committed
fix: configure log handler
1 parent dc68323 commit e07ce03

File tree

4 files changed

+490
-489
lines changed

4 files changed

+490
-489
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "uipath-runtime"
3-
version = "0.0.4"
4-
description = "UiPath Runtime abstractions"
3+
version = "0.0.5"
4+
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
88
"opentelemetry-sdk>=1.38.0",
99
"opentelemetry-instrumentation>=0.59b0",
1010
"pydantic>=2.12.3",
11-
"uipath-core>=0.0.3",
11+
"uipath-core>=0.0.3, <0.1.0",
1212
]
1313
classifiers = [
1414
"Intended Audience :: Developers",

src/uipath/runtime/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,16 @@ def __init__(
142142
delegate: T,
143143
trace_manager: UiPathTraceManager,
144144
root_span: str = "root",
145+
log_handler: Optional[UiPathRuntimeExecutionLogHandler] = None,
145146
execution_id: Optional[str] = None,
146147
):
147148
"""Initialize the executor."""
148149
self.delegate = delegate
149150
self.trace_manager = trace_manager
150151
self.root_span = root_span
151152
self.execution_id = execution_id
152-
self.log_handler: Optional[UiPathRuntimeExecutionLogHandler] = None
153-
if execution_id is not None:
153+
self.log_handler = log_handler
154+
if execution_id is not None and log_handler is None:
154155
self.log_handler = UiPathRuntimeExecutionLogHandler(execution_id)
155156

156157
async def execute(

tests/test_executor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,21 @@ async def test_multiple_factories_same_executor():
128128
# Execute runtime A
129129
runtime_a = factory_a.new_runtime(entrypoint="")
130130
execution_runtime_a = UiPathExecutionRuntime(
131-
runtime_a, trace_manager, "runtime-a-span", "exec-a"
131+
runtime_a, trace_manager, "runtime-a-span", execution_id="exec-a"
132132
)
133133
result_a = await execution_runtime_a.execute({"input": "a"})
134134

135135
# Execute runtime B
136136
runtime_b = factory_b.new_runtime(entrypoint="")
137137
execution_runtime_b = UiPathExecutionRuntime(
138-
runtime_b, trace_manager, "runtime-b-span", "exec-b"
138+
runtime_b, trace_manager, "runtime-b-span", execution_id="exec-b"
139139
)
140140
result_b = await execution_runtime_b.execute({"input": "b"})
141141

142142
# Execute runtime C with custom spans
143143
runtime_c = factory_c.new_runtime(entrypoint="")
144144
execution_runtime_c = UiPathExecutionRuntime(
145-
runtime_c, trace_manager, "runtime-c-span", "exec-c"
145+
runtime_c, trace_manager, "runtime-c-span", execution_id="exec-c"
146146
)
147147
result_c = await execution_runtime_c.execute({"input": "c"})
148148

0 commit comments

Comments
 (0)