oarepo-runtime 1.2.2__tar.gz → 1.2.4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {oarepo-runtime-1.2.2/oarepo_runtime.egg-info → oarepo-runtime-1.2.4}/PKG-INFO +1 -1
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/datastreams.py +5 -4
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/transformers.py +5 -2
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/__init__.py +4 -1
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ext.py +1 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4/oarepo_runtime.egg-info}/PKG-INFO +1 -1
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/setup.cfg +1 -1
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/LICENSE +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/MANIFEST.in +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/README.md +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/cli.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/mappings.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cli.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/permissions_presets.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/service.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/catalogue.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/cli.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/config.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/errors.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/fixtures.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/excel.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/json.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/service.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/yaml.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/service.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/yaml.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/expandable_fields.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/service.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ext_config.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/max_facet.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/nested_facet.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/i18n/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/i18n/validation.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/base.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/internal.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/lookup.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/mapping.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/pid_relation.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/tasks/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/tasks/datastreams.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ui/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ui/marshmallow.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/validation/__init__.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/validation/dates.py +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/SOURCES.txt +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/dependency_links.txt +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/entry_points.txt +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/requires.txt +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/top_level.txt +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/pyproject.toml +0 -0
- {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/setup.py +0 -0
@@ -9,6 +9,9 @@ from oarepo_runtime.datastreams.config import DATASTREAM_READERS, get_instance
|
|
9
9
|
|
10
10
|
from .errors import TransformerError, WriterError
|
11
11
|
import abc
|
12
|
+
import logging
|
13
|
+
|
14
|
+
log = logging.getLogger("datastreams")
|
12
15
|
|
13
16
|
|
14
17
|
class StreamEntry:
|
@@ -128,12 +131,10 @@ class DataStream(AbstractDataStream):
|
|
128
131
|
try:
|
129
132
|
writer.write(stream_entry)
|
130
133
|
except WriterError as err:
|
131
|
-
|
134
|
+
log.error("Error in writer: ", err, repr(stream_entry.entry))
|
132
135
|
stream_entry.errors.append(f"{writer.__class__.__name__}: {str(err)}")
|
133
136
|
except Exception as err:
|
134
|
-
|
135
|
-
"Unexpected error in writer: ", err, repr(stream_entry.entry)
|
136
|
-
)
|
137
|
+
log.error("Unexpected error in writer: ", err, repr(stream_entry.entry))
|
137
138
|
stream_entry.errors.append(f"{writer.__class__.__name__}: {str(err)}")
|
138
139
|
|
139
140
|
return stream_entry
|
@@ -6,7 +6,7 @@ from .datastreams import StreamEntry
|
|
6
6
|
class BaseTransformer(ABC):
|
7
7
|
"""Base transformer."""
|
8
8
|
|
9
|
-
def __init__(self) -> None:
|
9
|
+
def __init__(self, **kwargs) -> None:
|
10
10
|
pass
|
11
11
|
|
12
12
|
@abstractmethod
|
@@ -20,9 +20,12 @@ class BaseTransformer(ABC):
|
|
20
20
|
class BatchTransformer(BaseTransformer):
|
21
21
|
@abstractmethod
|
22
22
|
def apply_batch(
|
23
|
-
self,
|
23
|
+
self, stream_entries: List[StreamEntry], *args, **kwargs
|
24
24
|
) -> List[StreamEntry]:
|
25
25
|
"""Applies the transformation to the entry.
|
26
26
|
:returns: A StreamEntry. The transformed entry.
|
27
27
|
Raises TransformerError in case of errors.
|
28
28
|
"""
|
29
|
+
|
30
|
+
def apply(self, stream_entry: StreamEntry, *args, **kwargs) -> StreamEntry:
|
31
|
+
return self.apply_batch([stream_entry], *args, **kwargs)
|
{oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/__init__.py
RENAMED
@@ -24,8 +24,11 @@ class BaseWriter(ABC):
|
|
24
24
|
|
25
25
|
class BatchWriter(BaseWriter):
|
26
26
|
@abstractmethod
|
27
|
-
def write_batch(self,
|
27
|
+
def write_batch(self, entries: List[StreamEntry], *args, **kwargs):
|
28
28
|
"""Writes the input entry to the target output.
|
29
29
|
:returns: nothing
|
30
30
|
Raises WriterException in case of errors.
|
31
31
|
"""
|
32
|
+
|
33
|
+
def write(self, entry: StreamEntry, *args, **kwargs):
|
34
|
+
return self.write_batch([entry], *args, **kwargs)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/expandable_fields.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|