Skip to content

Commit

Permalink
add_iter_method_on_state_store
Browse files Browse the repository at this point in the history
  • Loading branch information
cel055 committed Nov 9, 2023
1 parent f995275 commit 70603c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Changes are grouped as follows
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [5.5.1]

### Added

* Added iter method on the state store to return the keys of the local state dict

## [5.5.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion cognite/extractorutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
Cognite extractor utils is a Python package that simplifies the development of new extractors.
"""

__version__ = "5.5.0"
__version__ = "5.5.1"
from .base import Extractor
6 changes: 5 additions & 1 deletion cognite/extractorutils/statestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
import threading
from abc import ABC, abstractmethod
from types import TracebackType
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union

from requests.exceptions import ConnectionError

Expand Down Expand Up @@ -309,6 +309,10 @@ def __contains__(self, external_id: str) -> bool:
def __len__(self) -> int:
return len(self._local_state)

def __iter__(self) -> Iterable:
for key in self._local_state:
yield key


class RawStateStore(AbstractStateStore):
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cognite-extractor-utils"
version = "5.5.0"
version = "5.5.1"
description = "Utilities for easier development of extractors for CDF"
authors = ["Mathias Lohne <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 70603c7

Please sign in to comment.