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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [1.14.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.14.0) - 2025-08-26

### Added

- Added `infrahubctl repository init` command to allow the initialization of an Infrahub repository using [infrahub-template](https://github.com/opsmill/infrahub-template). ([#466](https://github.com/opsmill/infrahub-sdk-python/issues/466))
- add support for NumberPool attributes in generated protocols

### Fixed

- Fix value lookup using a flat notation like `foo__bar__value` with relationships of cardinality one ([#6882](https://github.com/opsmill/infrahub-sdk-python/issues/6882))
- Create a new batch while fetching relationships instead of using the reusing the same one.
- Update internal calls to `count` to include the branch parameter so that the query is performed on the correct branch
- Update offset in process_page() which was causing a race condition in rare case. ([#514](https://github.com/opsmill/infrahub-sdk-python/pull/514))

## [1.13.5](https://github.com/opsmill/infrahub-sdk-python/tree/v1.13.5) - 2025-07-23

### Fixed
Expand Down
1 change: 0 additions & 1 deletion changelog/+add_numberpool_support_protocols.added.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog/+batch.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog/+branch-in-count.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog/466.added.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog/6882.fixed.md

This file was deleted.

4 changes: 2 additions & 2 deletions infrahub_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ async def filters(
async def process_page(page_offset: int, page_number: int) -> tuple[dict, ProcessRelationsNode]:
"""Process a single page of results."""
query_data = await InfrahubNode(client=self, schema=schema, branch=branch).generate_query_data(
offset=offset or page_offset,
offset=page_offset if offset is None else offset,
limit=limit or pagination_size,
filters=filters,
include=include,
Expand Down Expand Up @@ -1954,7 +1954,7 @@ def filters(
def process_page(page_offset: int, page_number: int) -> tuple[dict, ProcessRelationsNodeSync]:
"""Process a single page of results."""
query_data = InfrahubNodeSync(client=self, schema=schema, branch=branch).generate_query_data(
offset=offset or page_offset,
offset=page_offset if offset is None else offset,
limit=limit or pagination_size,
filters=filters,
include=include,
Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/node/node.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Iterable
from copy import copy
from copy import copy, deepcopy
from typing import TYPE_CHECKING, Any

from ..constants import InfrahubClientMode
Expand Down Expand Up @@ -397,7 +397,7 @@ def generate_query_data_init(
"edges": {"node": {"id": None, "hfid": None, "display_label": None, "__typename": None}},
}

data["@filters"] = filters or {}
data["@filters"] = deepcopy(filters) if filters is not None else {}

if order:
data["@filters"]["order"] = order
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "infrahub-sdk"
version = "1.13.5"
version = "1.14.0"
description = "Python Client to interact with Infrahub"
authors = ["OpsMill <[email protected]>"]
readme = "README.md"
Expand Down