Skip to content

bug(filter): bare RHS identifiers mis-evaluated as column refs in data filters #170

@pesap

Description

@pesap

Problem

filter { tech == wind } evaluates wind as identifier/column lookup, not categorical literal.
Result: filter resolves false/None and drops all rows.

This conflicts with spec §9:

  • Bare RHS identifier (e.g., thermal) should be categorical string value.

Repro

Minimal data:

tech
wind
solar
wind

KDL:

set "idx_wind" {
  in "idx"
  filter { tech == wind }
}

Observed: subset size = 0
Expected: subset size > 0 (rows where tech == "wind")

Scope

  • crates/arco-kdl/src/semantic/sets.rs
  • crates/arco-kdl/src/compile/data_tables.rs (keep behavior aligned for param filters)

Acceptance criteria

  • Bare RHS identifiers in comparisons behave as categorical literals.
  • Quoted RHS strings still work.
  • Numeric comparisons unchanged.
  • Add regression tests for set + param filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCommand line interfacedocsv0.5Version 0.5: Benchmarks + Logging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions