Skip to content

fix(iohandler): don't drop empty list/dict/tuple and literal False args to keep.* functions - #6738

Open
mmustafasenoglu wants to merge 1 commit into
keephq:mainfrom
mmustafasenoglu:fix-iohandler-empty-args
Open

fix(iohandler): don't drop empty list/dict/tuple and literal False args to keep.* functions#6738
mmustafasenoglu wants to merge 1 commit into
keephq:mainfrom
mmustafasenoglu:fix-iohandler-empty-args

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Fixes #6728

Problem

The argument-filtering guard in _parse_token was too complex and incorrectly dropped:

  • Empty containers: [], {}, () (falsy but not caught by special cases)
  • Literal False (equals 0 in Python, so _arg == 0 matched but then _arg is not False excluded it)

Solution

Changed the guard to simply if _arg is not None: since _arg is initialized to None and only stays None when parsing produces no value (e.g., a nested keep.* call that returns nothing). This correctly preserves all legitimate argument values including empty strings, zero, false, and empty collections.

…gs to keep.* functions

Fixes keephq#6728

The argument-filtering guard in _parse_token was too complex and incorrectly
dropped:
- Empty containers: [], {}, () (falsy but not caught by special cases)
- Literal False (equals 0 in Python, so _arg == 0 matched but then
  _arg is not False excluded it)

Changed the guard to simply if _arg is not None: since _arg is
initialized to None and only stays None when parsing produces no value
(e.g., a nested keep.* call that returns nothing). This correctly preserves
all legitimate argument values including empty strings, zero, false, and empty
collections.
Copilot AI lite review requested due to automatic review settings August 27, 2026 10:18
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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.

@dosubot dosubot Bot added the Bug Something isn't working label Aug 27, 2026
@CLAassistant

CLAassistant commented Aug 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: IOHandler silently drops empty list/dict/tuple (and literal False) arguments to keep.* template functions

3 participants