cocoindex 0.2.5__cp311-abi3-macosx_10_12_x86_64.whl → 0.2.6__cp311-abi3-macosx_10_12_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.
cocoindex/_engine.abi3.so CHANGED
Binary file
cocoindex/cli.py CHANGED
@@ -363,6 +363,13 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
363
363
  default=False,
364
364
  help="Continuously watch changes from data sources and apply to the target index.",
365
365
  )
366
+ @click.option(
367
+ "--reexport",
368
+ is_flag=True,
369
+ show_default=True,
370
+ default=False,
371
+ help="Reexport to targets even if there's no change.",
372
+ )
366
373
  @click.option(
367
374
  "--setup",
368
375
  is_flag=True,
@@ -389,6 +396,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
389
396
  def update(
390
397
  app_flow_specifier: str,
391
398
  live: bool,
399
+ reexport: bool,
392
400
  setup: bool, # pylint: disable=redefined-outer-name
393
401
  force: bool,
394
402
  quiet: bool,
@@ -408,7 +416,11 @@ def update(
408
416
  fg="yellow",
409
417
  )
410
418
 
411
- options = flow.FlowLiveUpdaterOptions(live_mode=live, print_stats=not quiet)
419
+ options = flow.FlowLiveUpdaterOptions(
420
+ live_mode=live,
421
+ reexport_targets=reexport,
422
+ print_stats=not quiet,
423
+ )
412
424
  if flow_name is None:
413
425
  if setup:
414
426
  _setup_flows(
cocoindex/flow.py CHANGED
@@ -563,9 +563,14 @@ class FlowBuilder:
563
563
  class FlowLiveUpdaterOptions:
564
564
  """
565
565
  Options for live updating a flow.
566
+
567
+ - live_mode: Whether to perform live update for data sources with change capture mechanisms.
568
+ - reexport_targets: Whether to reexport to targets even if there's no change.
569
+ - print_stats: Whether to print stats during update.
566
570
  """
567
571
 
568
572
  live_mode: bool = True
573
+ reexport_targets: bool = False
569
574
  print_stats: bool = False
570
575
 
571
576
 
@@ -759,20 +764,25 @@ class Flow:
759
764
  """
760
765
  return self._full_name
761
766
 
762
- def update(self) -> _engine.IndexUpdateInfo:
767
+ def update(self, /, *, reexport_targets: bool = False) -> _engine.IndexUpdateInfo:
763
768
  """
764
769
  Update the index defined by the flow.
765
770
  Once the function returns, the index is fresh up to the moment when the function is called.
766
771
  """
767
- return execution_context.run(self.update_async())
772
+ return execution_context.run(
773
+ self.update_async(reexport_targets=reexport_targets)
774
+ )
768
775
 
769
- async def update_async(self) -> _engine.IndexUpdateInfo:
776
+ async def update_async(
777
+ self, /, *, reexport_targets: bool = False
778
+ ) -> _engine.IndexUpdateInfo:
770
779
  """
771
780
  Update the index defined by the flow.
772
781
  Once the function returns, the index is fresh up to the moment when the function is called.
773
782
  """
774
783
  async with FlowLiveUpdater(
775
- self, FlowLiveUpdaterOptions(live_mode=False)
784
+ self,
785
+ FlowLiveUpdaterOptions(live_mode=False, reexport_targets=reexport_targets),
776
786
  ) as updater:
777
787
  await updater.wait_async()
778
788
  return updater.update_stats()
@@ -152,6 +152,16 @@ def _start_parent_watchdog(
152
152
 
153
153
 
154
154
  def _subprocess_init(user_apps: list[str], parent_pid: int) -> None:
155
+ import signal
156
+ import faulthandler
157
+
158
+ faulthandler.enable()
159
+ # Ignore SIGINT in the subprocess on best-effort basis.
160
+ try:
161
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
162
+ except Exception:
163
+ pass
164
+
155
165
  _start_parent_watchdog(parent_pid)
156
166
 
157
167
  # In case any user app is already in this subprocess, e.g. the subprocess is forked, we need to avoid loading it again.
@@ -193,10 +203,15 @@ _SUBPROC_EXECUTORS: dict[bytes, _ExecutorEntry] = {}
193
203
 
194
204
  def _call_method(method: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
195
205
  """Run an awaitable/coroutine to completion synchronously, otherwise return as-is."""
196
- if asyncio.iscoroutinefunction(method):
197
- return asyncio.run(method(*args, **kwargs))
198
- else:
199
- return method(*args, **kwargs)
206
+ try:
207
+ if asyncio.iscoroutinefunction(method):
208
+ return asyncio.run(method(*args, **kwargs))
209
+ else:
210
+ return method(*args, **kwargs)
211
+ except Exception as e:
212
+ raise RuntimeError(
213
+ f"Error calling method `{method.__name__}` from subprocess"
214
+ ) from e
200
215
 
201
216
 
202
217
  def _get_or_create_entry(key_bytes: bytes) -> _ExecutorEntry:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: License :: OSI Approved :: Apache Software License
6
6
  Classifier: Operating System :: OS Independent
@@ -34,6 +34,7 @@ Provides-Extra: dev
34
34
  Provides-Extra: embeddings
35
35
  Provides-Extra: colpali
36
36
  Provides-Extra: all
37
+ License-File: THIRD_PARTY_NOTICES.html
37
38
  Summary: With CocoIndex, users declare the transformation, CocoIndex creates & maintains an index, and keeps the derived index up to date based on source update, with minimal computation and changes.
38
39
  Keywords: indexing,real-time,incremental,pipeline,search,ai,etl,rag,dataflow,context-engineering
39
40
  Author-email: CocoIndex <cocoindex.io@gmail.com>
@@ -1,12 +1,13 @@
1
- cocoindex-0.2.5.dist-info/METADATA,sha256=103rko_UCWpL42QrZxf3AoZoVTqfwJ5fz3rSfSLCUzA,12930
2
- cocoindex-0.2.5.dist-info/WHEEL,sha256=N8W3-0eDM6igWj-H12r7VkxoMaJIqJLxUyWCFstEaGg,105
3
- cocoindex-0.2.5.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
1
+ cocoindex-0.2.6.dist-info/METADATA,sha256=pVFIVXRR33oc1_Y4uw95GKM29bXol6QzIfXJJ1MBqOU,12969
2
+ cocoindex-0.2.6.dist-info/WHEEL,sha256=N8W3-0eDM6igWj-H12r7VkxoMaJIqJLxUyWCFstEaGg,105
3
+ cocoindex-0.2.6.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.2.6.dist-info/licenses/THIRD_PARTY_NOTICES.html,sha256=ihni2G0h2JAjyQAZ2stGGAIHtsK-VaoXoaD-6YCSPsM,716358
4
5
  cocoindex/__init__.py,sha256=sLpSVO5Cotgn_82lawxvXnaqfa-qj33rytWBAe2MTtU,2201
5
- cocoindex/_engine.abi3.so,sha256=qB9fV9sK2gA-t804BFM9hqgRov94-C7RnpggD5CW3ic,69170164
6
+ cocoindex/_engine.abi3.so,sha256=BpICvgHBbW5SoMc-XrKJ7CIRLrcavZjHaEClhUqXyKk,69170212
6
7
  cocoindex/auth_registry.py,sha256=PE1-kVkcyC1G2C_V7b1kvYzeq73OFQehWKQP7ln7fJ8,1478
7
- cocoindex/cli.py,sha256=D-mlZrH-trT5UR3N5KfQeq2CQ95odO2FTi67WIPjzPM,21120
8
+ cocoindex/cli.py,sha256=jCWOfqiCfFSOLg1hSBjY_PIDqJu4gAOz-84RZkmtXoE,21352
8
9
  cocoindex/convert.py,sha256=Eh9Co37BtW_PK3Oi-pFEiFt8cc_6g7XLcurV-NeH6GU,22090
9
- cocoindex/flow.py,sha256=AoWt8i05MfEnnoAQR0EWzZU-9k36UmCFuNLb3itlGO0,37204
10
+ cocoindex/flow.py,sha256=wKT_RWeB9_sm764aNrOl2XU-RJIu4EK_sIkjcyZI8jA,37669
10
11
  cocoindex/functions.py,sha256=09erNt3WbzY9l1KER-akBF2O5-6xEahV2ORBECaL6yk,12260
11
12
  cocoindex/index.py,sha256=j93B9jEvvLXHtpzKWL88SY6wCGEoPgpsQhEGHlyYGFg,540
12
13
  cocoindex/lib.py,sha256=f--9dAYd84CZosbDZqNW0oGbBLsY3dXiUTR1VrfQ_QY,817
@@ -17,7 +18,7 @@ cocoindex/runtime.py,sha256=povilB3HH3y1JF-yxKwU-pD8n2WnAqyQxIgvXXHNc60,1080
17
18
  cocoindex/setting.py,sha256=cuudZ2uJvS48wh-rDToPAUN7-KMjlyQ-0hWhkHMIx4U,5282
18
19
  cocoindex/setup.py,sha256=7uIHKN4FOCuoidPXcKyGTrkqpkl9luL49-6UcnMxYzw,3068
19
20
  cocoindex/sources.py,sha256=FYz7cWYasLGDaYoIEQ1dF2uprgUETHWsTIrIS7n6pQE,3188
20
- cocoindex/subprocess_exec.py,sha256=aq459hCNjEnZvldIPB0eSuosr2jZDqPfT4zMwLsAnqk,9423
21
+ cocoindex/subprocess_exec.py,sha256=iTKFO3iPF4SsW2hon8YTpGDzbsjZM_wd8IYxzS6RN3o,9819
21
22
  cocoindex/targets.py,sha256=Nfh_tpFd1goTnS_cxBjIs4j9zl3Z4Z1JomAQ1dl3Sic,2796
22
23
  cocoindex/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
24
  cocoindex/tests/conftest.py,sha256=Q1ev90H_6zncEL0nlzgd4idIaE6OQW_8cMf05V-Wgec,1054
@@ -30,4 +31,4 @@ cocoindex/typing.py,sha256=lEQYIzAGVKQp6RnhyeopY9Q7xEED7yQj3ZMxvTPblV8,14200
30
31
  cocoindex/user_app_loader.py,sha256=bc3Af-gYRxJ9GpObtpjegZY855oQBCv5FGkrkWV2yGY,1873
31
32
  cocoindex/utils.py,sha256=hUhX-XV6XGCtJSEIpBOuDv6VvqImwPlgBxztBTw7u0U,598
32
33
  cocoindex/validation.py,sha256=PZnJoby4sLbsmPv9fOjOQXuefjfZ7gmtsiTGU8SH-tc,3090
33
- cocoindex-0.2.5.dist-info/RECORD,,
34
+ cocoindex-0.2.6.dist-info/RECORD,,