diff --git a/CHANGELOG.md b/CHANGELOG.md index 65affdae..b8e9608e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang +## [1.9.2](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.2) - 2025-03-26 + +### Changed + +- Remove hfid in upsert payload, to improve node upsert performances + ## [1.9.1](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.1) - 2025-03-21 ### Fixed diff --git a/infrahub_sdk/node.py b/infrahub_sdk/node.py index 864abf1c..a7ee537f 100644 --- a/infrahub_sdk/node.py +++ b/infrahub_sdk/node.py @@ -1418,8 +1418,10 @@ async def create( ) -> 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) mutation_name = f"{self._schema.kind}Upsert" tracker = f"mutation-{str(self._schema.kind).lower()}-upsert" else: diff --git a/pyproject.toml b/pyproject.toml index 360f9608..704d6bec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "infrahub-sdk" -version = "1.9.1" +version = "1.9.2" description = "Python Client to interact with Infrahub" authors = ["OpsMill "] readme = "README.md"