Skip to content

fix: return empty list instead of empty dict in load_training_data#971

Merged
regulartim merged 1 commit intointelowlproject:developfrom
Sanchit2662:fix/load-training-data-return-type
Mar 5, 2026
Merged

fix: return empty list instead of empty dict in load_training_data#971
regulartim merged 1 commit intointelowlproject:developfrom
Sanchit2662:fix/load-training-data-return-type

Conversation

@Sanchit2662
Copy link
Copy Markdown
Contributor

Description

I noticed that load_training_data() in scoring_jobs.py returns {} (empty dict) when loading fails, but the function signature says it returns list[dict] and the happy path returns a list from json.load(). The docstring also said "empty dict". I changed the fallback to return [] and updated the docstring to say "empty list" so everything is consistent with the declared return type.
closes #965

Type of change

  • [x ] Bug fix (non-breaking change which fixes an issue).

Checklist

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also created a pull request in the docs repository.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
@Sanchit2662
Copy link
Copy Markdown
Contributor Author

@regulartim , sorry again for the earlier mess-up! I've opened this fresh PR with the correct target branch this time. Would really appreciate a review when you get the chance 🙏

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@regulartim regulartim merged commit f96967a into intelowlproject:develop Mar 5, 2026
4 checks passed
cclts pushed a commit to cclts/GreedyBear that referenced this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants