Skip to content

Commit 7f950e8

Browse files
authored
Merge pull request #580 from UiPath/fix/tracing_enabled
2 parents 44e0b3b + ed87283 commit 7f950e8

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.45"
3+
version = "2.1.46"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_cli/_runtime/_contracts.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,17 +326,22 @@ def with_defaults(cls: type[C], config_path: Optional[str] = None, **kwargs) ->
326326

327327
base = cls.from_config(resolved_config_path)
328328

329+
bool_map = {"true": True, "false": False}
330+
tracing_enabled = os.environ.get("UIPATH_TRACING_ENABLED", True)
331+
if isinstance(tracing_enabled, str) and tracing_enabled.lower() in bool_map:
332+
tracing_enabled = bool_map[tracing_enabled.lower()]
333+
329334
# Apply defaults from env
330335
base.job_id = os.environ.get("UIPATH_JOB_KEY")
331336
base.trace_id = os.environ.get("UIPATH_TRACE_ID")
332-
base.tracing_enabled = os.environ.get("UIPATH_TRACING_ENABLED", True)
337+
base.tracing_enabled = tracing_enabled
333338
base.logs_min_level = os.environ.get("LOG_LEVEL", "INFO")
334339

335340
base.trace_context = UiPathTraceContext(
336341
trace_id=os.environ.get("UIPATH_TRACE_ID"),
337342
parent_span_id=os.environ.get("UIPATH_PARENT_SPAN_ID"),
338343
root_span_id=os.environ.get("UIPATH_ROOT_SPAN_ID"),
339-
enabled=os.environ.get("UIPATH_TRACING_ENABLED", True),
344+
enabled=tracing_enabled,
340345
job_id=os.environ.get("UIPATH_JOB_KEY"),
341346
org_id=os.environ.get("UIPATH_ORGANIZATION_ID"),
342347
tenant_id=os.environ.get("UIPATH_TENANT_ID"),

0 commit comments

Comments
 (0)