fix: use os.path.join for robust path handling in llm_op#1389
Closed
RithamSharma wants to merge 1 commit into
Closed
fix: use os.path.join for robust path handling in llm_op#1389RithamSharma wants to merge 1 commit into
RithamSharma wants to merge 1 commit into
Conversation
phil-opp
reviewed
Mar 17, 2026
| current_directory = os.path.dirname(current_file_path) | ||
|
|
||
| path = current_directory + "object_detection.py" | ||
| path = os.path.join(current_directory,"object_detection.py") # ← FIXED |
Collaborator
There was a problem hiding this comment.
Please remove the # ← FIXED comment.
3 tasks
Collaborator
|
Hi @RithamSharma — thanks for spotting this bug and posting the fix. Closing this PR but the fix is being rescued and credited to you in #1837. Your analysis was right:
You're credited via Two notes for next time, both small:
Thanks again — looking forward to your next PR. |
heyong4725
added a commit
that referenced
this pull request
May 16, 2026
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>
trunk-io Bot
pushed a commit
that referenced
this pull request
May 17, 2026
#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.