Skip to content

Commit

Permalink
fix issue of indexing from csv in case of the key is not avaliable
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledk2 committed Nov 15, 2024
1 parent 2548700 commit e0df579
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def prepare_images_data(data, data_source, doc_type):
elif rcd == "data_source":
row_to_insert[rcd] = data_source
else:
row_to_insert[rcd] = row[rcd]
row_to_insert[rcd] = row.get(rcd)

row_to_insert["key_values"] = []
data_to_be_inserted[row["id"]] = row_to_insert
Expand Down Expand Up @@ -289,9 +289,9 @@ def prepare_data(data, data_source, doc_type):
key_value = row_to_insert["key_values"]
key_value.append(
{
"name": row["mapvalue_name"],
"value": row["mapvalue_value"],
"index": row["mapvalue_index"],
"name": row.get("mapvalue_name"),
"value": row.get("mapvalue_value"),
"index": row.get("mapvalue_index"),
}
)

Expand Down

0 comments on commit e0df579

Please sign in to comment.