Skip to content

fix: correct aggregation error message case and aget_routes signature#667

Merged
jamescalam merged 1 commit into
aurelio-labs:mainfrom
totto:fix/aggregation-error-message-case
Jul 15, 2026
Merged

fix: correct aggregation error message case and aget_routes signature#667
jamescalam merged 1 commit into
aurelio-labs:mainfrom
totto:fix/aggregation-error-message-case

Conversation

@totto

@totto totto commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Changes

1. Aggregation error message uses wrong case (routers/base.py)

The validation checks against lowercase values but the error message told users to use uppercase:

if self.aggregation not in ["sum", "mean", "max"]:  # checks lowercase
    raise ValueError(
        f"... Choose either 'SUM', 'MEAN', or 'MAX'."  # ← uppercase
    )

Following the error message causes the same error to trigger again. Fixed by aligning the message to lowercase. Applied to both occurrences (lines 424 and 1533 before this change).

2. aget_routes in LocalIndex declared as sync (index/local.py)

aget_routes follows the a-prefix async convention used throughout the codebase (e.g. aadd, adelete, asearch) but was declared as a sync def. The error message also said "Sync remove is not implemented" — wrong method name and wrong type.

Fixed: async def aget_routes with correct error message.

3. Dead code after raise NotImplementedError in _refresh_routes

13 lines of unreachable code (incomplete draft implementation) were left after the raise NotImplementedError. Removed.

- routers/base.py: error message told users to pass 'SUM', 'MEAN', 'MAX'
  but the validation checks against lowercase 'sum', 'mean', 'max'. Anyone
  following the error message would trigger the same error again. Fix: align
  error message to lowercase. Applied to both call sites (lines 424, 1533).
  Also remove unreachable dead code after raise NotImplementedError in
  _refresh_routes.

- index/local.py: aget_routes was declared as a sync def despite the 'a'
  async prefix convention used throughout the codebase. The error message
  also said "Sync remove is not implemented" -- wrong method name and type.
  Fix: make it async def and correct the error message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamescalam

Copy link
Copy Markdown
Member

great catch, merging now thanks for the contribution!

@jamescalam
jamescalam merged commit 059dba2 into aurelio-labs:main Jul 15, 2026
5 of 6 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.

2 participants