port-ocean 0.12.2.dev2__py3-none-any.whl → 0.12.2.dev3__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.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- port_ocean/core/integrations/mixins/sync_raw.py +90 -89
- {port_ocean-0.12.2.dev2.dist-info → port_ocean-0.12.2.dev3.dist-info}/METADATA +1 -1
- {port_ocean-0.12.2.dev2.dist-info → port_ocean-0.12.2.dev3.dist-info}/RECORD +6 -6
- {port_ocean-0.12.2.dev2.dist-info → port_ocean-0.12.2.dev3.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.12.2.dev2.dist-info → port_ocean-0.12.2.dev3.dist-info}/WHEEL +0 -0
- {port_ocean-0.12.2.dev2.dist-info → port_ocean-0.12.2.dev3.dist-info}/entry_points.txt +0 -0
|
@@ -173,48 +173,49 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
173
173
|
self, resource_config: ResourceConfig, user_agent_type: UserAgentType
|
|
174
174
|
) -> tuple[list[Entity], list[Exception]]:
|
|
175
175
|
results, errors = await self._get_resource_raw_results(resource_config)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
)
|
|
176
|
+
passed_entities = []
|
|
177
|
+
# async_generators: list[ASYNC_GENERATOR_RESYNC_TYPE] = []
|
|
178
|
+
# raw_results: RAW_RESULT = []
|
|
179
|
+
# for result in results:
|
|
180
|
+
# if isinstance(result, dict):
|
|
181
|
+
# raw_results.append(result)
|
|
182
|
+
# else:
|
|
183
|
+
# async_generators.append(result)
|
|
184
|
+
#
|
|
185
|
+
# send_raw_data_examples_amount = (
|
|
186
|
+
# SEND_RAW_DATA_EXAMPLES_AMOUNT if ocean.config.send_raw_data_examples else 0
|
|
187
|
+
# )
|
|
188
|
+
# all_entities, register_errors = await self._register_resource_raw(
|
|
189
|
+
# resource_config,
|
|
190
|
+
# raw_results,
|
|
191
|
+
# user_agent_type,
|
|
192
|
+
# send_raw_data_examples_amount=send_raw_data_examples_amount,
|
|
193
|
+
# )
|
|
194
|
+
# errors.extend(register_errors)
|
|
195
|
+
# passed_entities = list(all_entities.passed)
|
|
196
|
+
#
|
|
197
|
+
# for generator in async_generators:
|
|
198
|
+
# try:
|
|
199
|
+
# async for items in generator:
|
|
200
|
+
# if send_raw_data_examples_amount > 0:
|
|
201
|
+
# send_raw_data_examples_amount = max(
|
|
202
|
+
# 0, send_raw_data_examples_amount - len(passed_entities)
|
|
203
|
+
# )
|
|
204
|
+
#
|
|
205
|
+
# entities, register_errors = await self._register_resource_raw(
|
|
206
|
+
# resource_config,
|
|
207
|
+
# items,
|
|
208
|
+
# user_agent_type,
|
|
209
|
+
# send_raw_data_examples_amount=send_raw_data_examples_amount,
|
|
210
|
+
# )
|
|
211
|
+
# errors.extend(register_errors)
|
|
212
|
+
# passed_entities.extend(entities.passed)
|
|
213
|
+
# except* OceanAbortException as error:
|
|
214
|
+
# errors.append(error)
|
|
215
|
+
#
|
|
216
|
+
# logger.info(
|
|
217
|
+
# f"Finished registering change for {len(results)} raw results for kind: {resource_config.kind}. {len(passed_entities)} entities were affected"
|
|
218
|
+
# )
|
|
218
219
|
return passed_entities, errors
|
|
219
220
|
|
|
220
221
|
async def register_raw(
|
|
@@ -426,20 +427,20 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
426
427
|
use_cache=False
|
|
427
428
|
)
|
|
428
429
|
logger.info(f"Resync will use the following mappings: {app_config.dict()}")
|
|
429
|
-
try:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
except httpx.HTTPError as e:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
430
|
+
# try:
|
|
431
|
+
# did_fetched_current_state = True
|
|
432
|
+
# entities_at_port = await ocean.port_client.search_entities(
|
|
433
|
+
# user_agent_type
|
|
434
|
+
# )
|
|
435
|
+
# except httpx.HTTPError as e:
|
|
436
|
+
# logger.warning(
|
|
437
|
+
# "Failed to fetch the current state of entities at Port. "
|
|
438
|
+
# "Skipping delete phase due to unknown initial state. "
|
|
439
|
+
# f"Error: {e}\n"
|
|
440
|
+
# f"Response status code: {e.response.status_code if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
441
|
+
# f"Response content: {e.response.text if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
442
|
+
# )
|
|
443
|
+
# did_fetched_current_state = False
|
|
443
444
|
|
|
444
445
|
creation_results: list[tuple[list[Entity], list[Exception]]] = []
|
|
445
446
|
|
|
@@ -458,36 +459,36 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
458
459
|
except asyncio.CancelledError as e:
|
|
459
460
|
logger.warning("Resync aborted successfully, skipping delete phase. This leads to an incomplete state")
|
|
460
461
|
raise
|
|
461
|
-
else:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
462
|
+
# else:
|
|
463
|
+
# if not did_fetched_current_state:
|
|
464
|
+
# logger.warning(
|
|
465
|
+
# "Due to an error before the resync, the previous state of entities at Port is unknown."
|
|
466
|
+
# " Skipping delete phase due to unknown initial state."
|
|
467
|
+
# )
|
|
468
|
+
# return
|
|
469
|
+
#
|
|
470
|
+
# logger.info("Starting resync diff calculation")
|
|
471
|
+
# flat_created_entities, errors = zip_and_sum(creation_results) or [
|
|
472
|
+
# [],
|
|
473
|
+
# [],
|
|
474
|
+
# ]
|
|
475
|
+
#
|
|
476
|
+
# if errors:
|
|
477
|
+
# message = f"Resync failed with {len(errors)}. Skipping delete phase due to incomplete state"
|
|
478
|
+
# error_group = ExceptionGroup(
|
|
479
|
+
# f"Resync failed with {len(errors)}. Skipping delete phase due to incomplete state",
|
|
480
|
+
# errors,
|
|
481
|
+
# )
|
|
482
|
+
# if not silent:
|
|
483
|
+
# raise error_group
|
|
484
|
+
#
|
|
485
|
+
# logger.error(message, exc_info=error_group)
|
|
486
|
+
# else:
|
|
487
|
+
# logger.info(
|
|
488
|
+
# f"Running resync diff calculation, number of entities at Port before resync: {len(entities_at_port)}, number of entities created during sync: {len(flat_created_entities)}"
|
|
489
|
+
# )
|
|
490
|
+
# await self.entities_state_applier.delete_diff(
|
|
491
|
+
# {"before": entities_at_port, "after": flat_created_entities},
|
|
492
|
+
# user_agent_type,
|
|
493
|
+
# )
|
|
494
|
+
# logger.info("Resync finished successfully")
|
|
@@ -94,7 +94,7 @@ port_ocean/core/integrations/mixins/__init__.py,sha256=FA1FEKMM6P-L2_m7Q4L20mFa4
|
|
|
94
94
|
port_ocean/core/integrations/mixins/events.py,sha256=Ddfx2L4FpghV38waF8OfVeOV0bHBxNIgjU-q5ffillI,2341
|
|
95
95
|
port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
|
|
96
96
|
port_ocean/core/integrations/mixins/sync.py,sha256=B9fEs8faaYLLikH9GBjE_E61vo0bQDjIGQsQ1SRXOlA,3931
|
|
97
|
-
port_ocean/core/integrations/mixins/sync_raw.py,sha256=
|
|
97
|
+
port_ocean/core/integrations/mixins/sync_raw.py,sha256=uJpcCDYXkS42snXkt6LXWTCO14xhQDWUDwJEEdRXAMk,19109
|
|
98
98
|
port_ocean/core/integrations/mixins/utils.py,sha256=7y1rGETZIjOQadyIjFJXIHKkQFKx_SwiP-TrAIsyyLY,2303
|
|
99
99
|
port_ocean/core/models.py,sha256=dJ2_olTdbjUpObQJNmg7e7EENU_zZiX6XOaknNp54B0,1342
|
|
100
100
|
port_ocean/core/ocean_types.py,sha256=3_d8-n626f1kWLQ_Jxw194LEyrOVupz05qs_Y1pvB-A,990
|
|
@@ -140,8 +140,8 @@ port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,32
|
|
|
140
140
|
port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
|
|
141
141
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
|
142
142
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
143
|
-
port_ocean-0.12.2.
|
|
144
|
-
port_ocean-0.12.2.
|
|
145
|
-
port_ocean-0.12.2.
|
|
146
|
-
port_ocean-0.12.2.
|
|
147
|
-
port_ocean-0.12.2.
|
|
143
|
+
port_ocean-0.12.2.dev3.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
144
|
+
port_ocean-0.12.2.dev3.dist-info/METADATA,sha256=_xCDGNZxbMAPgCdhpvjDlFj1Bm-R9x26E6nXNcIUai4,6619
|
|
145
|
+
port_ocean-0.12.2.dev3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
146
|
+
port_ocean-0.12.2.dev3.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
147
|
+
port_ocean-0.12.2.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|