pyspiral 0.7.9__cp312-abi3-manylinux_2_28_x86_64.whl → 0.7.10__cp312-abi3-manylinux_2_28_x86_64.whl

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.

Potentially problematic release.


This version of pyspiral might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyspiral
3
- Version: 0.7.9
3
+ Version: 0.7.10
4
4
  Classifier: Intended Audience :: Science/Research
5
5
  Classifier: Operating System :: OS Independent
6
6
  Classifier: Programming Language :: Python
@@ -1,8 +1,8 @@
1
- pyspiral-0.7.9.dist-info/METADATA,sha256=La_MkKyTCJ_qrYYT2eGLaPYkaf9OSpNa36nYOfMaN_4,1874
2
- pyspiral-0.7.9.dist-info/WHEEL,sha256=ydlpo1_yEJ2g1Axq3LoOd_OfioJa2swc2j5IDCa4uho,107
3
- pyspiral-0.7.9.dist-info/entry_points.txt,sha256=R96Y3FpYX6XbQu9qMPfUTgiCcf4qM9OBQQZTDdBkZwA,74
1
+ pyspiral-0.7.10.dist-info/METADATA,sha256=rCgXce3dHmwg5oIvXTHJnnMMEX93NFLvTRbUY0Ns9-Y,1875
2
+ pyspiral-0.7.10.dist-info/WHEEL,sha256=ydlpo1_yEJ2g1Axq3LoOd_OfioJa2swc2j5IDCa4uho,107
3
+ pyspiral-0.7.10.dist-info/entry_points.txt,sha256=R96Y3FpYX6XbQu9qMPfUTgiCcf4qM9OBQQZTDdBkZwA,74
4
4
  spiral/__init__.py,sha256=PwaYBWFBtB7cYi7peMmhk_Lm5XzjRoLwOtLbUhc1ZDo,1449
5
- spiral/_lib.abi3.so,sha256=jpQ5vqK5-SgdNp-oHrMgE2oJSuPxJamtjVNAmAfn8oI,68064024
5
+ spiral/_lib.abi3.so,sha256=fbdXuFFBMXuFd6-B9k-9LmTtt4eSV5r-sYfRqSbK8bA,68064904
6
6
  spiral/adbc.py,sha256=7IxfWIeQN-fh0W5OdN_PP2x3pzQYg6ZUOLsHg3jktqw,14842
7
7
  spiral/api/__init__.py,sha256=ULBlVq3PnfNOO6T5naE_ULmmii-83--qTuN2PpAUQN0,2241
8
8
  spiral/api/admin.py,sha256=A1iVR1XYJSObZivPAD5UzmPuMgupXc9kaHNYYa_kwfs,585
@@ -60,7 +60,7 @@ spiral/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  spiral/debug/manifests.py,sha256=7f1O3ba9mrA5nXpOF9cEIQuUAteP5wiBkFy_diQJ7No,3216
61
61
  spiral/debug/metrics.py,sha256=XdRDcjggtsLNGCAjam6IxG9072pz_d2C8iLApNRFUtk,2044
62
62
  spiral/debug/scan.py,sha256=UEm_aRnql5pwDPTpZgakMLNjlzkKL4RurBFFqH_BLAQ,9526
63
- spiral/enrichment.py,sha256=j8CzWJqLRq0Zko-qz3NzicsFOAvdzQSRJ58vdmqxPsk,9879
63
+ spiral/enrichment.py,sha256=t3CFnidG1kGHeJk1zIMVyImKapUJQx1OXvGn88brOo4,11059
64
64
  spiral/expressions/__init__.py,sha256=ZsD8g7vB0G7xy19GUiH4m79kw7KEkTQRwJl5Gn1cgtw,8049
65
65
  spiral/expressions/base.py,sha256=PvhJkcUSsPSIaxirHVzM9zlqyBXiaiia1HXohXdOmL4,5377
66
66
  spiral/expressions/file.py,sha256=7D9jIENJcoT0KFharBLkzK9dZgO4DYn5K_KCt0twefg,518
@@ -106,4 +106,4 @@ spiral/table.py,sha256=p95AYv6b7e14F3t7j-B-r45k9CtG84ngikdlAhh9WxA,12260
106
106
  spiral/text_index.py,sha256=FQ9rgIEGLSJryS9lFdMhKtPFey18BXoWbPXyvZPJJ04,442
107
107
  spiral/transaction.py,sha256=bI5oqBAmPMSF0yOOYcPfGbV37Xc1-_V-wQNKw1xOlTA,4136
108
108
  spiral/types_.py,sha256=W_jyO7F6rpPiH69jhgSgV7OxQZbOlb1Ho3InpKUP6Eo,155
109
- pyspiral-0.7.9.dist-info/RECORD,,
109
+ pyspiral-0.7.10.dist-info/RECORD,,
spiral/_lib.abi3.so CHANGED
Binary file
spiral/enrichment.py CHANGED
@@ -160,15 +160,48 @@ class Enrichment:
160
160
  logger.info(f"Applying enrichment with {len(shards)} shards. Follow progress at {client.dashboard_link}")
161
161
 
162
162
  failed_ranges = []
163
- for result in client.gather(enrichments):
164
- result: EnrichmentTaskResult
165
-
166
- if result.error is not None:
167
- logger.error(f"Enrichment task failed for range {result.key_range}: {result.error}")
168
- failed_ranges.append(result.key_range)
169
- continue
170
-
171
- tx.include(result.ops)
163
+ try:
164
+ for result, shard in zip(client.gather(enrichments), shards):
165
+ result: EnrichmentTaskResult
166
+
167
+ if result.error is not None:
168
+ logger.error(f"Enrichment task failed for range {shard.key_range}: {result.error}")
169
+ failed_ranges.append(shard.key_range)
170
+ continue
171
+
172
+ tx.include(result.ops)
173
+ except Exception as e:
174
+ # If not incremental, re-raise the exception.
175
+ if checkpoint_dump is None:
176
+ raise e
177
+
178
+ # Handle worker failures (e.g., KilledWorker from Dask)
179
+ from dask.distributed import KilledWorker
180
+
181
+ if not isinstance(e, KilledWorker):
182
+ # Re-raise other exceptions
183
+ raise e
184
+
185
+ logger.error(f"Dask worker was killed during enrichment: {e}")
186
+
187
+ # Try to gather partial results and mark remaining tasks as failed
188
+ for future, shard in zip(enrichments, shards):
189
+ if future.done() and not future.exception():
190
+ try:
191
+ result = future.result()
192
+
193
+ if result.error is not None:
194
+ logger.error(f"Enrichment task failed for range {shard.key_range}: {result.error}")
195
+ failed_ranges.append(shard.key_range)
196
+ continue
197
+
198
+ tx.include(result.ops)
199
+ except Exception:
200
+ # Task failed or incomplete, add to failed ranges
201
+ failed_ranges.append(shard.key_range)
202
+ else:
203
+ # Task didn't complete, add to failed ranges
204
+ failed_ranges.append(shard.key_range)
172
205
 
173
206
  # Dump checkpoint of failed ranges, if any.
174
207
  if checkpoint_dump is not None:
@@ -212,7 +245,6 @@ def _checkpoint_dump_key_ranges(checkpoint_dump: str, ranges: list[KeyRange]):
212
245
 
213
246
  @dataclasses.dataclass
214
247
  class EnrichmentTaskResult:
215
- key_range: KeyRange
216
248
  ops: list[Operation]
217
249
  error: str | None = None
218
250
 
@@ -220,12 +252,9 @@ class EnrichmentTaskResult:
220
252
  return {
221
253
  "ops": [op.to_json() for op in self.ops],
222
254
  "error": self.error,
223
- "begin": bytes(self.key_range.begin),
224
- "end": bytes(self.key_range.end),
225
255
  }
226
256
 
227
257
  def __setstate__(self, state):
228
- self.key_range = KeyRange(begin=Key(state["begin"]), end=Key(state["end"]))
229
258
  self.ops = [Operation.from_json(op_json) for op_json in state["ops"]]
230
259
  self.error = state["error"]
231
260
 
@@ -255,12 +284,12 @@ def _enrichment_task(
255
284
 
256
285
  try:
257
286
  task_tx.writeback(task_scan, key_range=shard.key_range, partition_size_bytes=partition_size_bytes)
258
- return EnrichmentTaskResult(key_range=shard.key_range, ops=task_tx.take())
287
+ return EnrichmentTaskResult(ops=task_tx.take())
259
288
  except Exception as e:
260
289
  task_tx.abort()
261
290
 
262
291
  if incremental:
263
- return EnrichmentTaskResult(key_range=shard.key_range, ops=[], error=str(e))
292
+ return EnrichmentTaskResult(ops=[], error=str(e))
264
293
 
265
294
  logger.error(f"Enrichment task failed for shard {shard}: {e}")
266
295
  raise e