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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datafun
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: datafun brings the fun back to data pipelines
5
5
  Author-email: "Diego Giorgini, Luigi Di Sotto, Saeed Choobani" <diego.giorgini@aitechnologies.it>
6
6
  Requires-Python: >=3.8
@@ -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(f"Source datasets only process StartOfStream requests.")
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 == False:
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(f"Aggregate: Argument init is not a function")
1017
+ raise TypeError("Aggregate: Argument init is not a function")
1018
1018
  if not isinstance(agg, Callable):
1019
- raise TypeError(f"Aggregate: Argument agg is not a function")
1019
+ raise TypeError("Aggregate: Argument agg is not a function")
1020
1020
  if not isinstance(agg, Callable):
1021
- raise TypeError(f"Aggregate: Argument reduce is not a function")
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 (scroll_sz := len(hits)) > 0:
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(f'Field query.bool.filter has not been found.')
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datafun
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: datafun brings the fun back to data pipelines
5
5
  Author-email: "Diego Giorgini, Luigi Di Sotto, Saeed Choobani" <diego.giorgini@aitechnologies.it>
6
6
  Requires-Python: >=3.8
@@ -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.1"
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