Skip to content

Commit 283cf4c

Browse files
daniel-thomclaude
andcommitted
Clarify that transform feature matching is intentionally exact
The _features_contain helper is an exact per-pair match, stricter than the SQL LIKE-based partial feature filter it replaced, which could over-match on substrings (key=1 matching key=10) and on LIKE wildcard characters in string values. Reword the comment to state that intent and use === instead of isequal so Bool and Int feature values do not cross-match (isequal(true, 1) is true in Julia). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6efc44d commit 283cf4c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/system_data.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,13 @@ function _transform_single_time_series!(
707707
return
708708
end
709709

710-
# Replicates the SQL partial feature match used by list_metadata: every requested
711-
# feature key-value pair must be present in the existing metadata's features.
710+
# Every requested feature key-value pair must be present in the existing metadata's
711+
# features. This is an intentionally exact match, stricter than the SQL LIKE-based
712+
# partial feature match in list_metadata, which can over-match on substrings
713+
# (e.g., a request for key=1 matches a stored key=10) and on LIKE wildcard
714+
# characters in string values.
712715
_features_contain(existing_features, requested_features) =
713-
all(kv -> isequal(get(existing_features, kv.first, nothing), kv.second),
716+
all(kv -> get(existing_features, kv.first, nothing) === kv.second,
714717
requested_features)
715718

716719
"""

0 commit comments

Comments
 (0)