Skip to content

Commit

Permalink
es indices() empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfisher-geo committed Nov 24, 2024
1 parent 45cd558 commit aa4dfbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def indices(collection_ids: Optional[List[str]]) -> str:
Returns:
A string of comma-separated index names. If `collection_ids` is None, returns the default indices.
"""
if collection_ids is None:
if collection_ids is None or collection_ids == []:
return ITEM_INDICES
else:
return ",".join([index_by_collection_id(c) for c in collection_ids])
Expand Down Expand Up @@ -764,7 +764,6 @@ def _fill_aggregation_parameters(name: str, agg: dict) -> dict:
for k, v in self.aggregation_mapping.items()
if k in aggregations
}

index_param = indices(collection_ids)
search_task = asyncio.create_task(
self.client.search(
Expand Down
6 changes: 2 additions & 4 deletions stac_fastapi/tests/extensions/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async def test_aggregate_filter_extension_neq_post(app_client, ctx):


@pytest.mark.asyncio
async def test_aggregate_extension_gte_get(app_client):
async def test_aggregate_extension_gte_get(app_client, ctx):
# there's one item that can match, so one of these queries should match it and the other shouldn't
resp = await app_client.get(
'/aggregate?aggregations=total_count&filter-lang=cql2-json&filter={"op":"<=","args":[{"property": "properties.proj:epsg"},32756]}'
Expand Down Expand Up @@ -387,9 +387,7 @@ async def test_aggregate_datetime_non_interval(app_client):
@pytest.mark.asyncio
async def test_post_aggregate_total_count(app_client):

params = {
"aggregations": ["total_count"],
}
params = {"aggregations": ["total_count"]}

resp = await app_client.post("/aggregate", json=params)

Expand Down

0 comments on commit aa4dfbf

Please sign in to comment.