Skip to content

FOLLOW-UP: Extract shared utility functions from source and runtime packages (from PR #215) #219

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #215.

Source PR: #215
PR Title: feat: add computed source type for derived/aggregated data
Suggested by: Code reuse review

Task Description

Several utility functions are duplicated between internal/source/computed.go and internal/runtime/expr.go:

  • getField / getFieldValue — case-insensitive field lookup on row maps
  • toFloat64 / tryFloat64 — numeric type conversion with different coverage
  • sumValues / sumField — field aggregation with divergent error handling
  • applyFilter / filterData — row filtering with different comparison semantics

These have subtly different behavior (e.g., computed.go skips non-numeric silently while expr.go returns errors). A shared internal/fieldutil package would consolidate these and ensure consistent behavior.


This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumMedium: quality, platform coverage, CIfollow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions