Skip to content

Commit

Permalink
Fix data modeling executor for WASM (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt authored Nov 14, 2023
1 parent 5484ca3 commit f03038b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Changes are grouped as follows
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [7.0.1] - 2023-11-14
### Fixed
- Data modeling APIs now work in WASM-like environments missing the threading module.

## [7.0.0] - 2023-11-14
This release ensure that all CogniteResources have `.dump` and `.load` methods, and that calling these two methods
in sequence produces an equal object to the original, for example,
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

__version__ = "7.0.0"
__version__ = "7.0.1"
__api_subversion__ = "V20220125"
4 changes: 3 additions & 1 deletion cognite/client/utils/_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ def get_data_modeling_executor(cls) -> ThreadPoolExecutor:
Returns:
ThreadPoolExecutor: The data modeling executor.
"""
assert cls.use_threadpool(), "use get_executor instead"
if cls.use_mainthread():
return cls.get_mainthread_executor() # type: ignore [return-value]

global _DATA_MODELING_THREAD_POOL_EXECUTOR_SINGLETON
try:
executor = _DATA_MODELING_THREAD_POOL_EXECUTOR_SINGLETON
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "cognite-sdk"

version = "7.0.0"
version = "7.0.1"
description = "Cognite Python SDK"
readme = "README.md"
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_unit/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def test_multiple_ids_not_found(self, api_client_with_token, rsps):
identifiers=IdentifierSequence.of(1, 2),
)
assert {"id": 1} in e.value.not_found
assert {"id": 2} in e.value.not_found
assert {"id": 2} in e.value.not_found + e.value.skipped

def test_cognite_client_is_set(self, cognite_client, api_client_with_token, mock_by_ids):
res = api_client_with_token._retrieve_multiple(
Expand Down

0 comments on commit f03038b

Please sign in to comment.