Skip to content

Commit

Permalink
Make sure any relationships or links are ingested when consuming JSONL (
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs authored Jan 14, 2025
1 parent f71a1fb commit f2a1d50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions optimade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def insert_from_jsonl(jsonl_path: Path, create_default_index: bool = False) -> N

inp_data = entry["attributes"]
inp_data["id"] = id
if "relationships" in entry:
inp_data["relationships"] = entry["relationships"]
if "links" in entry:
inp_data["links"] = entry["links"]
# Append the data to the batch
batch[_type].append(inp_data)
except Exception as exc:
Expand Down

0 comments on commit f2a1d50

Please sign in to comment.