From 70a50fbbc9c113f3e70177f99a6165f6db78b92f Mon Sep 17 00:00:00 2001 From: Matt Jones <47545907+SoundMatt@users.noreply.github.com> Date: Fri, 22 May 2026 11:02:21 -0700 Subject: [PATCH] fix(rule_translator): correct logic for skipping None/all-None-list values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guard before `set_attr` read: if value != None and (isinstance(value, list) and not all(...)): The second operand of `and` requires `value` to be a list, so any non-None scalar value (str, int, AST object) was silently dropped, because a scalar is not a list — and that sub-expression was False. The intent is: skip if value is None, *or* if value is a list whose every element is None. The correct condition is: if value is not None and (not isinstance(value, list) or not all(...)): Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com> --- ifex/transformers/rule_translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifex/transformers/rule_translator.py b/ifex/transformers/rule_translator.py index 976500c2..727d113e 100644 --- a/ifex/transformers/rule_translator.py +++ b/ifex/transformers/rule_translator.py @@ -388,7 +388,7 @@ def transform(mapping_table, input_obj): value = transform_value_common(mapping_table, getattr_value(input_obj, input_attr), field_transform) # Set attribute unless the result was None (or sometimes due to list handling, a *list* of None values) - if value != None and (isinstance(value, list) and not all([x == None for x in value])): + if value is not None and (not isinstance(value, list) or not all(x is None for x in value)): set_attr(attributes, output_attr, value) # Mark this attribute as handled