fix: remove unused json_tensors dead variable in convert_to_model_input()#259
Open
teyrebaz33 wants to merge 1 commit intoOpenGradient:mainfrom
Open
fix: remove unused json_tensors dead variable in convert_to_model_input()#259teyrebaz33 wants to merge 1 commit intoOpenGradient:mainfrom
teyrebaz33 wants to merge 1 commit intoOpenGradient:mainfrom
Conversation
…ut() Fixes OpenGradient#250 json_tensors was initialized but never populated or returned, creating a silent data loss trap for future JSON tensor support. Removed the dead variable to keep the code clean and explicit.
kylexqian
approved these changes
Apr 9, 2026
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.
Summary
Fixes #250
Problem
convert_to_model_input()in_conversions.pyinitializedjson_tensors = []but never populated it or included it in the return value. This is dead code that creates a silent data loss trap — if someone adds JSON tensor support to the collection loop in the future without fixing the return statement, JSON inputs will silently disappear.Fix
Removed the unused
json_tensorsvariable entirely. If JSON tensor support is added in the future, it should be introduced together with the collection logic, return statement update, and caller updates in the same PR.Changes
src/opengradient/client/_conversions.py: Removed deadjson_tensors = []variable