From 33a0d1c2d7e313625b0a5ab4d23b8eabbcb81a78 Mon Sep 17 00:00:00 2001 From: Marcelo Date: Tue, 21 Nov 2023 10:15:57 +0100 Subject: [PATCH] return of the iter method the return of the __iter__ method on the state store now returns an iterator --- CHANGELOG.md | 6 ++++++ cognite/extractorutils/__init__.py | 2 +- cognite/extractorutils/statestore.py | 4 ++-- pyproject.toml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab5e3ac..353a64ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [5.5.2] + +### Fixed + + * Fixed iter method on the state store to return an iterator + ## [5.5.1] ### Added diff --git a/cognite/extractorutils/__init__.py b/cognite/extractorutils/__init__.py index 6c15c82e..64553e14 100644 --- a/cognite/extractorutils/__init__.py +++ b/cognite/extractorutils/__init__.py @@ -16,5 +16,5 @@ Cognite extractor utils is a Python package that simplifies the development of new extractors. """ -__version__ = "5.5.1" +__version__ = "5.5.2" from .base import Extractor diff --git a/cognite/extractorutils/statestore.py b/cognite/extractorutils/statestore.py index a957666e..41051c5c 100644 --- a/cognite/extractorutils/statestore.py +++ b/cognite/extractorutils/statestore.py @@ -90,7 +90,7 @@ import threading from abc import ABC, abstractmethod from types import TracebackType -from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union +from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union from requests.exceptions import ConnectionError @@ -309,7 +309,7 @@ def __contains__(self, external_id: str) -> bool: def __len__(self) -> int: return len(self._local_state) - def __iter__(self) -> Iterable[str]: + def __iter__(self) -> Iterator[str]: for key in self._local_state: yield key diff --git a/pyproject.toml b/pyproject.toml index 8c1f2ca4..1dcd0c6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cognite-extractor-utils" -version = "5.5.1" +version = "5.5.2" description = "Utilities for easier development of extractors for CDF" authors = ["Mathias Lohne "] license = "Apache-2.0"