Skip to content

Commit 93a34b9

Browse files
committed
Update es_location for indexed operation.
1 parent 77b849d commit 93a34b9

File tree

1 file changed

+4
-6
lines changed
  • stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/models

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ def validate_model(cls, data: Any):
112112
data["es_key"] = f"['{data['key']}']"
113113
data["es_nest"] = "".join([f"['{part}']" for part in data["parts"]])
114114
data["es_location"] = data["es_nest"] + data["es_key"]
115-
data[
116-
"variable_name"
117-
] = f"{data['nest'].replace('.','_').replace(':','_')}_{data['key'].replace(':','_')}"
115+
data["variable_name"] = f"{data['nest'].replace('.','_').replace(':','_')}_{data['key'].replace(':','_')}"
118116
data["param_key"] = data["location"].translate(replacements)
119117

120118
if "index" in data:
@@ -124,8 +122,8 @@ def validate_model(cls, data: Any):
124122
else str(data["index"])
125123
)
126124

127-
data[
128-
"variable_name"
129-
] = f"{data['location'].replace('.','_').replace(':','_')}_{data['index']}"
125+
data["es_location"] = data["es_location"] + f"[{data['es_index']}]"
126+
127+
data["variable_name"] = f"{data['location'].replace('.','_').replace(':','_')}_{data['index']}"
130128

131129
return data

0 commit comments

Comments
 (0)