Skip to content

Conversation

mhilton
Copy link
Contributor

@mhilton mhilton commented Jun 23, 2025

A negative offset does not make sense with a limit function. Detect if a negative offset is being used and produce an error, rather than waiting for arrow to panic.

Fixes influxdata/influxdb#23265

Checklist

Dear Author 👋, the following checks should be completed (or explicitly dismissed) before merging.

  • ✏️ Write a PR description, regardless of triviality, to include the value of this PR
  • 🔗 Reference related issues
  • 🏃 Test cases are included to exercise the new code
  • 🧪 If new packages are being introduced to stdlib, link to Working Group discussion notes and ensure it lands under experimental/
  • 📖 If language features are changing, ensure docs/Spec.md has been updated

Dear Reviewer(s) 👋, you are responsible (among others) for ensuring the completeness and quality of the above before approval.

A negative offset does not make sense with a limit function. Detect if
a negative offset is being used and produce an error, rather than
waiting for arrow to panic.
@mhilton mhilton requested a review from a team as a code owner June 23, 2025 08:34
@mhilton mhilton requested review from Copilot and removed request for a team June 23, 2025 08:34
Copy link

@Copilot 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

This PR adds an error check to the limit operation to ensure that a negative offset is not allowed and introduces new tests to verify the behavior.

  • Added a negative offset test case to trigger an error.
  • Implemented an error return in the limit operator for negative offset values.

Reviewed Changes

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

File Description
stdlib/universe/limit_test.go Added tests to validate the limit function behavior with offsets.
stdlib/universe/limit.go Updated the LimitOpSpec creation to error on negative offsets.

@mhilton mhilton merged commit 81145f2 into master Jun 23, 2025
7 checks passed
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.

flux service die after run a query
2 participants