Skip to content

convert_to_model_input() builds json_tensors list but never includes it in the return value (dead data, silent data loss) #250

@verseon0980

Description

@verseon0980

File: src/opengradient/client/_conversions.py lines 60, 112

The function initialises json_tensors = [] on line 60 but the return statement on line 112 only returns (number_tensors, string_tensors)

The json_tensors list is never populated no elif branch for JSON dtype and is never returned.

This is entirely dead code,

But it sets up a future trap: if someone adds JSON tensor support to the collection loop without fixing the return statement, JSON inputs will silently disappear.

Current return:
pythonreturn number_tensors, string_tensors

Remove the dead variable. If JSON tensor input is intended:

pythonreturn number_tensors, string_tensors, json_tensors

and update all callers accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions