Skip to content

Commit 96e1ecb

Browse files
committed
Update path key type.
1 parent b426609 commit 96e1ecb

File tree

2 files changed

+3
-4
lines changed
  • stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers

2 files changed

+3
-4
lines changed

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/database/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def test_commands(
214214
commands.add(
215215
f"if (ctx._source{path.es_nest} instanceof ArrayList)"
216216
f"{{if (ctx._source{path.es_nest}[{path.es_key}] != {value})"
217-
f"{{Debug.explain('Test failed `{path.es_path}`"
217+
f"{{Debug.explain('Test failed `{path.path}`"
218218
f" != ' + ctx._source{path.es_path});}}"
219219
f"}} else "
220220
)

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/models/patch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""patch helpers."""
22

33
import re
4-
from typing import Any, Dict, Optional
4+
from typing import Any, Dict, Optional, Union
55

66
from pydantic import BaseModel, model_validator
77

@@ -74,7 +74,7 @@ class ElasticPath(BaseModel):
7474
parts: list[str] = []
7575

7676
path: Optional[str] = None
77-
key: Optional[str] = None
77+
key: Optional[Union[str, int]] = None
7878
nest: Optional[str] = None
7979

8080
es_path: Optional[str] = None
@@ -114,7 +114,6 @@ def validate_model(cls, data: Any):
114114
if data["key"] < 0
115115
else str(data["key"])
116116
)
117-
# data["es_key"] = f"[{data['key']}]"
118117
data["es_path"] = data["es_nest"] + f"[{data['es_key']}]"
119118

120119
data[

0 commit comments

Comments
 (0)