Skip to content

🐛 Fix signed integer list parsing - #3828

Open
original4422 wants to merge 1 commit into
ModelEngine-Group:developfrom
original4422:fix/3818-parse-signed-integers
Open

🐛 Fix signed integer list parsing#3828
original4422 wants to merge 1 commit into
ModelEngine-Group:developfrom
original4422:fix/3818-parse-signed-integers

Conversation

@original4422

Copy link
Copy Markdown

Summary

  • parse whitespace-trimmed signed integers instead of filtering them with str.isdigit()
  • warn when malformed non-empty entries are skipped while retaining valid entries
  • add regression coverage for signed round-trips and malformed mixed input

Root cause

convert_string_to_list filtered tokens through str.isdigit() before conversion. That rejected -1 and +1, even though convert_list_to_string can serialize negative integers, and it silently discarded malformed entries.

Validation

  • uvx --from pytest pytest test/backend/utils/test_str_utils.py -q (18 passed)
  • uvx ruff check --select E,F,I backend/utils/str_utils.py test/backend/utils/test_str_utils.py
  • uvx ruff format --check backend/utils/str_utils.py test/backend/utils/test_str_utils.py
  • python3 -m compileall -q backend/utils/str_utils.py test/backend/utils/test_str_utils.py
  • git diff --check

Fixes #3818

Copilot AI lite review requested due to automatic review settings August 31, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@original4422

Copy link
Copy Markdown
Author

Hi @Dallas98, when you have a chance, could you please take a look and let me know whether this is ready to merge or needs any changes? Thank you.

@original4422

Copy link
Copy Markdown
Author

Hi @WMC001, when you have a chance, could you please review this signed-integer parsing fix and let me know if any changes are needed before it can be merged? Thank you!

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.

convert_string_to_list silently drops negative integers and non-digit entries

2 participants