Skip to content

Failure when applying filters to the brain-region endpoint #571

@GianlucaFicarelli

Description

@GianlucaFicarelli

Environment

Logged in staging, verified locally in entitycore 2026.4.0.

Description

The brain-region endpoint fails with some filters:

  1. http://127.0.0.1:8000/brain-region?semantic_search=thalamus&page=1&page_size=10&id=e3e70682-c209-4cac-a29f-6fbed82c07cd&hierarchy_id=e3e70682-c209-4cac-a29f-6fbed82c07cd&order_by=name&species__id=e3e70682-c209-4cac-a29f-6fbed82c07cd&strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd

-> sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateAlias) table name "brain_region_hierarchy" specified more than once

  1. http://127.0.0.1:8000/brain-region?strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd

-> sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) missing FROM-clause entry for table "species"

To Reproduce

Call the urls above.

Expected behavior

Return the json payload with the list of results.

Acceptance criteria

  • The endpoint 1 above succeeds
  • The endpoint 2 above succeeds

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions