Skip to content

Commit 176a805

Browse files
author
nazarfil
committed
fix: exposes pipeline run id
1 parent 51cd688 commit 176a805

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

openhexa/sdk/pipelines/run.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class CurrentRun:
2020
def _connected(self):
2121
return "HEXA_SERVER_URL" in os.environ
2222

23+
def id(self):
24+
"""Exposes pipeline run id."""
25+
if "HEXA_RUN_ID" in os.environ:
26+
return os.environ["HEXA_RUN_ID"]
27+
else:
28+
raise RuntimeError("Current run ID is not set. Make sure you are running this in a pipeline context.")
29+
2330
def add_file_output(self, path: str):
2431
"""Record a run output for a file creation operation.
2532

0 commit comments

Comments
 (0)