Skip to content

Commit ab99599

Browse files
authored
Merge pull request #510 from opsmill/stable
Merge stable into develop
2 parents c1a1fb0 + 4f7725b commit ab99599

File tree

10 files changed

+22
-13
lines changed

10 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [1.14.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.14.0) - 2025-08-26
15+
16+
### Added
17+
18+
- 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))
19+
- add support for NumberPool attributes in generated protocols
20+
21+
### Fixed
22+
23+
- 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))
24+
- Create a new batch while fetching relationships instead of using the reusing the same one.
25+
- Update internal calls to `count` to include the branch parameter so that the query is performed on the correct branch
26+
- Update offset in process_page() which was causing a race condition in rare case. ([#514](https://github.com/opsmill/infrahub-sdk-python/pull/514))
27+
1428
## [1.13.5](https://github.com/opsmill/infrahub-sdk-python/tree/v1.13.5) - 2025-07-23
1529

1630
### Fixed

changelog/+add_numberpool_support_protocols.added.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/+batch.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/+branch-in-count.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/466.added.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/6882.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

infrahub_sdk/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ async def filters(
790790
async def process_page(page_offset: int, page_number: int) -> tuple[dict, ProcessRelationsNode]:
791791
"""Process a single page of results."""
792792
query_data = await InfrahubNode(client=self, schema=schema, branch=branch).generate_query_data(
793-
offset=offset or page_offset,
793+
offset=page_offset if offset is None else offset,
794794
limit=limit or pagination_size,
795795
filters=filters,
796796
include=include,
@@ -1954,7 +1954,7 @@ def filters(
19541954
def process_page(page_offset: int, page_number: int) -> tuple[dict, ProcessRelationsNodeSync]:
19551955
"""Process a single page of results."""
19561956
query_data = InfrahubNodeSync(client=self, schema=schema, branch=branch).generate_query_data(
1957-
offset=offset or page_offset,
1957+
offset=page_offset if offset is None else offset,
19581958
limit=limit or pagination_size,
19591959
filters=filters,
19601960
include=include,

infrahub_sdk/node/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Iterable
4-
from copy import copy
4+
from copy import copy, deepcopy
55
from typing import TYPE_CHECKING, Any
66

77
from ..constants import InfrahubClientMode
@@ -397,7 +397,7 @@ def generate_query_data_init(
397397
"edges": {"node": {"id": None, "hfid": None, "display_label": None, "__typename": None}},
398398
}
399399

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

402402
if order:
403403
data["@filters"]["order"] = order

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "infrahub-sdk"
3-
version = "1.13.5"
3+
version = "1.14.0"
44
description = "Python Client to interact with Infrahub"
55
authors = ["OpsMill <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)