Skip to content

Fix database schema patch: api_constraints should support multiple inputs per task type #214

@lucifer4330k

Description

@lucifer4330k

Description

There's a TODO comment indicating that api_constraints in the test database currently only supports one input per task type, requiring a database patch.

Location

src/routers/openml/tasktype.py:70

# api_constraints is for one input only in the test database (TODO: patch db)
if isinstance(task_type_input.api_constraints, str):
    constraint = json.loads(task_type_input.api_constraints)
    input_["data_type"] = constraint["data_type"]

Impact

  • Limited functionality for task types with multiple inputs
  • Database schema doesn't match expected behavior
  • Workaround code required in application layer

Expected Behavior

The database schema should properly support multiple inputs per task type with individual api_constraints for each.

Suggested Implementation

  1. Review current database schema for task_type_inout table
  2. Ensure api_constraints can store multiple entries or is properly normalized
  3. Update test database with correct schema
  4. Remove conditional workaround code once schema is fixed
  5. Add database migration script

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions