Skip to content

✨ feat(table): add map_rows, filter_rows, and sort_rows functions#1230

Merged
harehare merged 1 commit intomainfrom
feat/add-table-row-operations
Feb 7, 2026
Merged

✨ feat(table): add map_rows, filter_rows, and sort_rows functions#1230
harehare merged 1 commit intomainfrom
feat/add-table-row-operations

Conversation

@harehare
Copy link
Copy Markdown
Owner

@harehare harehare commented Feb 7, 2026

Add row transformation operations to the table module:

  • map_rows: applies a function to each row
  • filter_rows: filters rows based on a predicate
  • sort_rows: sorts rows by column index or default ordering

Also registers the table module in the resolver for static lookup.

Add row transformation operations to the table module:
- map_rows: applies a function to each row
- filter_rows: filters rows based on a predicate
- sort_rows: sorts rows by column index or default ordering

Also registers the table module in the resolver for static lookup.
Copilot AI review requested due to automatic review settings February 7, 2026 05:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds row-level transformation helpers to the table module and enables static module resolution for table.

Changes:

  • Register table in the module resolver for static lookup.
  • Add map_rows, filter_rows, and sort_rows helpers to modules/table.mq.
  • Add module tests covering the new row transformation functions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/mq-lang/src/module/resolver.rs Adds table to the static module-name mapping.
crates/mq-lang/modules/table.mq Introduces row transformation helpers (map/filter/sort) for table rows.
crates/mq-lang/modules/module_tests.mq Adds tests validating row mapping, filtering, and sorting behavior.

end

# Map a function over each row in the table.
def map_rows(table, f):
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name f is ambiguous for public helpers; it’s unclear whether it’s a row-mapper or predicate. Consider renaming to something more specific (e.g., row_fn / predicate) to make call sites self-documenting.

Copilot generated this review using guidance from repository custom instructions.
end

# Filter rows in the table based on a predicate function.
def filter_rows(table, f):
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name f is ambiguous for public helpers; it’s unclear whether it’s a row-mapper or predicate. Consider renaming to something more specific (e.g., row_fn / predicate) to make call sites self-documenting.

Copilot generated this review using guidance from repository custom instructions.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 7, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing feat/add-table-row-operations (09b840f) with main (0150620)1

Summary

✅ 29 untouched benchmarks

Footnotes

  1. No successful run was found on main (b609992) during the generation of this report, so 0150620 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare harehare merged commit 5479ab8 into main Feb 7, 2026
7 checks passed
@harehare harehare deleted the feat/add-table-row-operations branch February 7, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants