File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ def test_commands(
214
214
commands .add (
215
215
f"if (ctx._source{ path .es_nest } instanceof ArrayList)"
216
216
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 } `"
218
218
f" != ' + ctx._source{ path .es_path } );}}"
219
219
f"}} else "
220
220
)
Original file line number Diff line number Diff line change 1
1
"""patch helpers."""
2
2
3
3
import re
4
- from typing import Any , Dict , Optional
4
+ from typing import Any , Dict , Optional , Union
5
5
6
6
from pydantic import BaseModel , model_validator
7
7
@@ -74,7 +74,7 @@ class ElasticPath(BaseModel):
74
74
parts : list [str ] = []
75
75
76
76
path : Optional [str ] = None
77
- key : Optional [str ] = None
77
+ key : Optional [Union [ str , int ] ] = None
78
78
nest : Optional [str ] = None
79
79
80
80
es_path : Optional [str ] = None
@@ -114,7 +114,6 @@ def validate_model(cls, data: Any):
114
114
if data ["key" ] < 0
115
115
else str (data ["key" ])
116
116
)
117
- # data["es_key"] = f"[{data['key']}]"
118
117
data ["es_path" ] = data ["es_nest" ] + f"[{ data ['es_key' ]} ]"
119
118
120
119
data [
You can’t perform that action at this time.
0 commit comments