Skip to content

Commit 366c4ca

Browse files
heyong4725RithamSharmaclaude
authored
fix(examples): use os.path.join for object_detection.py path in llm_op (#1837)
The __main__ block of `examples/python-operator-dataflow/llm_op.py` (a developer-mode entry point for exercising the operator directly, distinct from the operator import path used by the dora dataflow) built a path via string concatenation: path = current_directory + "object_detection.py" This produces `<dir>object_detection.py` with no separator, so `python llm_op.py` would always fail to open the file unless it happened to be in a directory whose name ended in a path separator. Rescue of #1389 (RithamSharma) which identified the bug and the correct fix (os.path.join). Reimplemented with PEP 8 spacing and without the trailing debug comment so the example stays clean. Co-authored-by: RithamSharma <RithamSharma@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2acf5da commit 366c4ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/python-operator-dataflow/llm_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def ask_llm(self, prompt):
299299
# Directory of the current file
300300
current_directory = os.path.dirname(current_file_path)
301301

302-
path = current_directory + "object_detection.py"
302+
path = os.path.join(current_directory, "object_detection.py")
303303
with open(path, encoding="utf8") as f:
304304
raw = f.read()
305305

0 commit comments

Comments
 (0)