port-ocean 0.30.5__py3-none-any.whl → 0.30.7__py3-none-any.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.
@@ -144,11 +144,11 @@ class JQEntityProcessor(BaseEntityProcessor):
144
144
  entity_mapping_fault_counter: int,
145
145
  ) -> None:
146
146
  if len(entity_misconfigurations) > 0:
147
- logger.info(
147
+ logger.error(
148
148
  f"Unable to find valid data for: {entity_misconfigurations} (null, missing, or misconfigured)"
149
149
  )
150
150
  if missing_required_fields:
151
- logger.info(
151
+ logger.error(
152
152
  f"{entity_mapping_fault_counter} transformations of batch failed due to empty, null or missing values"
153
153
  )
154
154
 
@@ -512,3 +512,37 @@ async def test_regular_coroutine_with_self_param_not_filtered(
512
512
 
513
513
  # Keys should not be the same because 'self' is not filtered
514
514
  assert key1 != key2
515
+
516
+
517
+ @pytest.mark.asyncio
518
+ async def test_cache_iterator_maintains_chunks(
519
+ mock_ocean: Any, monkeypatch: Any
520
+ ) -> None:
521
+ monkeypatch.setattr(cache, "ocean", mock_ocean)
522
+
523
+ call_count = 0
524
+
525
+ @cache.cache_iterator_result()
526
+ async def chunked_iterator() -> AsyncGenerator[List[int], None]:
527
+ nonlocal call_count
528
+ call_count += 1
529
+ yield [1, 2]
530
+ await asyncio.sleep(0.01)
531
+ yield [3, 4]
532
+
533
+ # First call - populates cache
534
+ results1 = []
535
+ async for chunk in chunked_iterator():
536
+ results1.append(chunk)
537
+
538
+ assert results1 == [[1, 2], [3, 4]]
539
+ assert call_count == 1
540
+
541
+ # Second call - reads from cache
542
+ results2 = []
543
+ async for chunk in chunked_iterator():
544
+ results2.append(chunk)
545
+
546
+ # Verify structure is preserved (chunks remain separate)
547
+ assert results2 == [[1, 2], [3, 4]]
548
+ assert call_count == 1
port_ocean/utils/cache.py CHANGED
@@ -86,7 +86,8 @@ def cache_iterator_result() -> Callable[[AsyncIteratorCallable], AsyncIteratorCa
86
86
  # Check if the result is already in the cache
87
87
  try:
88
88
  if cache := await ocean.app.cache_provider.get(cache_key):
89
- yield cache
89
+ for chunk in cache:
90
+ yield chunk
90
91
  return
91
92
  except FailedToReadCacheError as e:
92
93
  logger.warning(f"Failed to read cache for {cache_key}: {str(e)}")
@@ -94,7 +95,7 @@ def cache_iterator_result() -> Callable[[AsyncIteratorCallable], AsyncIteratorCa
94
95
  # If not in cache, fetch the data
95
96
  cached_results = list()
96
97
  async for result in func(*args, **kwargs):
97
- cached_results.extend(result)
98
+ cached_results.append(result)
98
99
  yield result
99
100
 
100
101
  # Cache the results
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.30.5
3
+ Version: 0.30.7
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -106,7 +106,7 @@ port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py,sha
106
106
  port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py,sha256=lyv6xKzhYfd6TioUgR3AVRSJqj7JpAaj1LxxU2xAqeo,1720
107
107
  port_ocean/core/handlers/entity_processor/__init__.py,sha256=FvFCunFg44wNQoqlybem9MthOs7p1Wawac87uSXz9U8,156
108
108
  port_ocean/core/handlers/entity_processor/base.py,sha256=PsnpNRqjHth9xwOvDRe7gKu8cjnVV0XGmTIHGvOelX0,1867
109
- port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=_ldJ71UIfZuNcLOgV5FYKllFohrtK13rDT9dI78ekPc,33279
109
+ port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=uGNo17A5esYIF7B9ihRWDs-TqIyuJvWt2XtLwgM405I,33281
110
110
  port_ocean/core/handlers/entity_processor/jq_input_evaluator.py,sha256=R88wf69RVtBl8t5m2IKGTmgt4JEQSbct_AmHI_tUOjg,5350
111
111
  port_ocean/core/handlers/port_app_config/__init__.py,sha256=8AAT5OthiVM7KCcM34iEgEeXtn2pRMrT4Dze5r1Ixbk,134
112
112
  port_ocean/core/handlers/port_app_config/api.py,sha256=r_Th66NEw38IpRdnXZcRvI8ACfvxW_A6V62WLwjWXlQ,1044
@@ -210,11 +210,11 @@ port_ocean/tests/test_metrics_endpoints.py,sha256=cOljs3NweC1hyP03iEaPKGv1Vt_y0O
210
210
  port_ocean/tests/test_ocean.py,sha256=bsXKGTVEjwLSbR7-qSmI4GZ-EzDo0eBE3TNSMsWzYxM,1502
211
211
  port_ocean/tests/test_smoke.py,sha256=uix2uIg_yOm8BHDgHw2hTFPy1fiIyxBGW3ENU_KoFlo,2557
212
212
  port_ocean/tests/utils/test_async_iterators.py,sha256=3PLk1emEXekb8LcC5GgVh3OicaX15i5WyaJT_eFnu_4,1336
213
- port_ocean/tests/utils/test_cache.py,sha256=AJrBRC1N0Yxq6ekYbZYUleb588GMK_4cGr41wcSI5bA,15561
213
+ port_ocean/tests/utils/test_cache.py,sha256=EKXZeUrCuMOr1XW1E0ObqOXyRiziy9z2-EDG1pIRhWc,16441
214
214
  port_ocean/utils/__init__.py,sha256=KMGnCPXZJbNwtgxtyMycapkDz8tpSyw23MSYT3iVeHs,91
215
215
  port_ocean/utils/async_http.py,sha256=aDsw3gQIMwt6qLegbZtkHqD8em48tKvbITnblsrTY3g,1260
216
216
  port_ocean/utils/async_iterators.py,sha256=CPXskYWkhkZtAG-ducEwM8537t3z5usPEqXR9vcivzw,3715
217
- port_ocean/utils/cache.py,sha256=WCKs6gV8uToLWOQtfw6LKlqE94dxf0TBHRz4ZaUyky4,5400
217
+ port_ocean/utils/cache.py,sha256=yLifQ4HWDxsAcHnigmq3CKUmFuc-X5uwuoFOEEfQWec,5444
218
218
  port_ocean/utils/ipc.py,sha256=eTjTTvsKl6IXYeOkIjP5iyrw-8gLQ9rf15WeyxCqXog,912
219
219
  port_ocean/utils/misc.py,sha256=cQGBWL9IN7ER6s7xyHzeKvj60ntW70WiYIq9MyLe1nY,2123
220
220
  port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwzB4,2762
@@ -222,8 +222,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
222
222
  port_ocean/utils/signal.py,sha256=J1sI-e_32VHP_VUa5bskLMFoJjJOAk5isrnewKDikUI,2125
223
223
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
224
224
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
225
- port_ocean-0.30.5.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
226
- port_ocean-0.30.5.dist-info/METADATA,sha256=bTE9t8Hx2DR2YUvA0RGM3AGwdvmYn3mCXTxJUJL66UU,7095
227
- port_ocean-0.30.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
228
- port_ocean-0.30.5.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
229
- port_ocean-0.30.5.dist-info/RECORD,,
225
+ port_ocean-0.30.7.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
226
+ port_ocean-0.30.7.dist-info/METADATA,sha256=yhpz6MhQJbnfoqEshsGCT3nccx7bF9u9S19w1epTRiI,7095
227
+ port_ocean-0.30.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
228
+ port_ocean-0.30.7.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
229
+ port_ocean-0.30.7.dist-info/RECORD,,