Skip to content

Commit 7b0fb1a

Browse files
authored
fix verda.containers.get_compute_resources() (#81)
1 parent 11efb36 commit 7b0fb1a

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [1.20.0] - 2025-02-05
10+
## [1.21.0] - 2026-03-02
11+
12+
### Fixed
13+
14+
- Fixed `verda.containers.get_compute_resources()`
15+
16+
## [1.20.0] - 2026-02-05
1117

1218
### Added
1319

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "verda"
3-
version = "1.20.0"
3+
version = "1.21.0"
44
description = "Official Python SDK for Verda (formerly DataCrunch) Public API"
55
readme = "README.md"
66
requires-python = ">=3.10"

tests/unit_tests/containers/test_containers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def test_get_compute_resources(self, containers_service, compute_resources_endpo
540540
responses.GET,
541541
compute_resources_endpoint,
542542
# Wrap in list to simulate resource groups
543-
json=[COMPUTE_RESOURCES_DATA],
543+
json=COMPUTE_RESOURCES_DATA,
544544
status=200,
545545
)
546546

@@ -564,7 +564,7 @@ def test_get_compute_resources_filter_by_size(
564564
responses.add(
565565
responses.GET,
566566
compute_resources_endpoint,
567-
json=[COMPUTE_RESOURCES_DATA],
567+
json=COMPUTE_RESOURCES_DATA,
568568
status=200,
569569
)
570570

@@ -588,7 +588,7 @@ def test_get_compute_resources_filter_by_availability(
588588
responses.add(
589589
responses.GET,
590590
compute_resources_endpoint,
591-
json=[COMPUTE_RESOURCES_DATA],
591+
json=COMPUTE_RESOURCES_DATA,
592592
status=200,
593593
)
594594

@@ -609,7 +609,7 @@ def test_get_compute_resources_filter_by_size_and_availability(
609609
responses.add(
610610
responses.GET,
611611
compute_resources_endpoint,
612-
json=[COMPUTE_RESOURCES_DATA],
612+
json=COMPUTE_RESOURCES_DATA,
613613
status=200,
614614
)
615615

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

verda/containers/_containers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,9 +1001,8 @@ def get_compute_resources(
10011001
"""
10021002
response = self.client.get(SERVERLESS_COMPUTE_RESOURCES_ENDPOINT)
10031003
resources = []
1004-
for resource_group in response.json():
1005-
for resource in resource_group:
1006-
resources.append(ComputeResource.from_dict(resource))
1004+
for resource in response.json():
1005+
resources.append(ComputeResource.from_dict(resource))
10071006
if size:
10081007
resources = [r for r in resources if r.size == size]
10091008
if is_available:

0 commit comments

Comments
 (0)