Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/upsertperformances.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve node upsert performances
4 changes: 3 additions & 1 deletion infrahub_sdk/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,10 @@
) -> None:
mutation_query = self._generate_mutation_query()

# Upserting means we may want to create, meaning payload contains all mandatory fields required for a creation,
# so hfid is just redondant information. Currently, upsert mutation has performance overhead if `hfid` is filled.
if allow_upsert:
input_data = self._generate_input_data(exclude_hfid=False, request_context=request_context)
input_data = self._generate_input_data(exclude_hfid=True, request_context=request_context)

Check warning on line 1424 in infrahub_sdk/node.py

View check run for this annotation

Codecov / codecov/patch

infrahub_sdk/node.py#L1424

Added line #L1424 was not covered by tests
mutation_name = f"{self._schema.kind}Upsert"
tracker = f"mutation-{str(self._schema.kind).lower()}-upsert"
else:
Expand Down