Skip to content

Infrahub Python SDK v0.14.0 #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 4, 2024
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [0.14.0](https://github.com/opsmill/infrahub-sdk-python/tree/v0.14.0) - 2024-10-04

### Removed

- Removed depreceted methods InfrahubClient.init and InfrahubClientSync.init ([#33](https://github.com/opsmill/infrahub-sdk-python/issues/33))

### Changed

- Query filters are not validated locally anymore, the validation will be done on the server side instead. ([#9](https://github.com/opsmill/infrahub-sdk-python/issues/9))
- Method client.get() can now return `None` instead of raising an exception when `raise_when_missing` is set to False

```python
response = await clients.get(
kind="CoreRepository", name__value="infrahub-demo", raise_when_missing=False
)
``` ([#11](https://github.com/opsmill/infrahub-sdk-python/issues/11))

### Fixed

- prefix and address attribute filters are now available in the Python SDK ([#10](https://github.com/opsmill/infrahub-sdk-python/issues/10))
- Queries using isnull as a filter are now supported by the Python SDK ([#30](https://github.com/opsmill/infrahub-sdk-python/issues/30))
- `execute_graphql` method for InfrahubClient(Sync) now properly considers the `default_branch` setting ([#46](https://github.com/opsmill/infrahub-sdk-python/issues/46))

## [0.13.1.dev0](https://github.com/opsmill/infrahub-sdk-python/tree/v0.13.1.dev0) - 2024-09-24

### Added
Expand Down
1 change: 0 additions & 1 deletion changelog/33.removed.md

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions infrahub_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from infrahub_sdk.exceptions import (
AuthenticationError,
Error,
FilterNotFoundError,
GraphQLError,
NodeNotFoundError,
ServerNotReachableError,
Expand Down Expand Up @@ -50,7 +49,6 @@
"InfrahubNodeSync",
"InfrahubRepositoryConfig",
"InfrahubSchema",
"FilterNotFoundError",
"generate_uuid",
"GenericSchema",
"GraphQLQueryAnalyzer",
Expand Down
6 changes: 2 additions & 4 deletions infrahub_sdk/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BatchTask:
task: Callable[[Any], Awaitable[Any]]
args: tuple[Any, ...]
kwargs: dict[str, Any]
node: Optional[InfrahubNode] = None
node: Optional[Any] = None


async def execute_batch_task_in_pool(
Expand Down Expand Up @@ -43,9 +43,7 @@ def __init__(
def num_tasks(self) -> int:
return len(self._tasks)

def add(
self, *args: Any, task: Callable[[Any], Awaitable[Any]], node: Optional[InfrahubNode] = None, **kwargs: Any
) -> None:
def add(self, *args: Any, task: Callable, node: Optional[Any] = None, **kwargs: Any) -> None:
self._tasks.append(BatchTask(task=task, node=node, args=args, kwargs=kwargs))

async def execute(self) -> AsyncGenerator:
Expand Down
Loading