datafun 0.5.1__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datafun-0.5.1 → datafun-0.5.2}/PKG-INFO +1 -1
- {datafun-0.5.1 → datafun-0.5.2}/datafun/dataset.py +5 -5
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/elk.py +4 -2
- {datafun-0.5.1 → datafun-0.5.2}/datafun.egg-info/PKG-INFO +1 -1
- {datafun-0.5.1 → datafun-0.5.2}/pyproject.toml +1 -1
- {datafun-0.5.1 → datafun-0.5.2}/LICENSE +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/README.md +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/__init__.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/cache.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/__init__.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/gcs.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/iterable.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/local_file.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/sources/rest.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun/utils.py +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun.egg-info/SOURCES.txt +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun.egg-info/dependency_links.txt +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun.egg-info/requires.txt +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/datafun.egg-info/top_level.txt +0 -0
- {datafun-0.5.1 → datafun-0.5.2}/setup.cfg +0 -0
|
@@ -312,7 +312,7 @@ class DatasetSource(Dataset):
|
|
|
312
312
|
|
|
313
313
|
def __call__(self, stream: Stream, **kwargs) -> Generator[Stream, None, None]:
|
|
314
314
|
if not isinstance(stream, StartOfStream):
|
|
315
|
-
raise TypeError(
|
|
315
|
+
raise TypeError("Source datasets only process StartOfStream requests.")
|
|
316
316
|
|
|
317
317
|
# propagate StartOfStream
|
|
318
318
|
_ = self.forward(stream)
|
|
@@ -683,7 +683,7 @@ class CacheDatasetSource(DatasetSource):
|
|
|
683
683
|
|
|
684
684
|
def _generate_examples(self) -> Generator[tuple, None, None]:
|
|
685
685
|
# Restart called after a keyboard interrupt in the middle of a generation
|
|
686
|
-
if self.cached_data != [] and self.finished
|
|
686
|
+
if self.cached_data != [] and self.finished is False:
|
|
687
687
|
self.cached_data = []
|
|
688
688
|
|
|
689
689
|
if self.cached_data == []:
|
|
@@ -1014,11 +1014,11 @@ class Aggregate(DatasetNode):
|
|
|
1014
1014
|
**kwargs,
|
|
1015
1015
|
):
|
|
1016
1016
|
if not isinstance(init, Callable):
|
|
1017
|
-
raise TypeError(
|
|
1017
|
+
raise TypeError("Aggregate: Argument init is not a function")
|
|
1018
1018
|
if not isinstance(agg, Callable):
|
|
1019
|
-
raise TypeError(
|
|
1019
|
+
raise TypeError("Aggregate: Argument agg is not a function")
|
|
1020
1020
|
if not isinstance(agg, Callable):
|
|
1021
|
-
raise TypeError(
|
|
1021
|
+
raise TypeError("Aggregate: Argument reduce is not a function")
|
|
1022
1022
|
|
|
1023
1023
|
super().__init__(
|
|
1024
1024
|
function=agg,
|
|
@@ -57,7 +57,7 @@ class ELKDataset(DatasetSource):
|
|
|
57
57
|
hits = dl.get(res, 'hits.hits', default=[])
|
|
58
58
|
|
|
59
59
|
old_scroll_id = dl.get(res, '_scroll_id')
|
|
60
|
-
while
|
|
60
|
+
while len(hits) > 0:
|
|
61
61
|
# iterate over the document hits for each 'scroll'
|
|
62
62
|
for doc in hits: # type: ignore
|
|
63
63
|
yield doc
|
|
@@ -74,6 +74,8 @@ class ELKDataset(DatasetSource):
|
|
|
74
74
|
# _scroll_id is None, because the response is not "paginated"
|
|
75
75
|
hits = []
|
|
76
76
|
|
|
77
|
+
self.es.clear_scroll(scroll_id=old_scroll_id)
|
|
78
|
+
|
|
77
79
|
def set_time_interval(self, query: dict) -> dict:
|
|
78
80
|
if not isinstance(query, dict):
|
|
79
81
|
raise ValueError(f"query must be a dict, not {type(query)}.")
|
|
@@ -88,7 +90,7 @@ class ELKDataset(DatasetSource):
|
|
|
88
90
|
|
|
89
91
|
xs = dl.get(query, 'query.bool.filter')
|
|
90
92
|
if xs is None:
|
|
91
|
-
raise ValueError(
|
|
93
|
+
raise ValueError('Field query.bool.filter has not been found.')
|
|
92
94
|
if not isinstance(xs, List):
|
|
93
95
|
raise TypeError(f'Field query.bool.filter must be of type List, but found of type {type(xs)}')
|
|
94
96
|
|
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
{ name = "Diego Giorgini, Luigi Di Sotto, Saeed Choobani", email = "diego.giorgini@aitechnologies.it" }
|
|
9
9
|
]
|
|
10
10
|
description = "datafun brings the fun back to data pipelines"
|
|
11
|
-
version = "0.5.
|
|
11
|
+
version = "0.5.2"
|
|
12
12
|
requires-python = ">=3.8"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"backoff",
|
|
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
|