port-ocean 0.24.12__py3-none-any.whl → 0.24.15__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.
@@ -24,6 +24,7 @@ from port_ocean.helpers.metric.metric import MetricPhase, MetricType
24
24
  ENTITIES_BULK_SAMPLES_SIZE = 10
25
25
  ENTITIES_BULK_ESTIMATED_SIZE_MULTIPLIER = 1.5
26
26
  ENTITIES_BULK_MINIMUM_BATCH_SIZE = 1
27
+ ENTITIES_BULK_UPSERT_CONCURRENCY = 5
27
28
 
28
29
 
29
30
  class EntityClientMixin:
@@ -199,7 +200,8 @@ class EntityClientMixin:
199
200
  :return: httpx.HTTPStatusError if there was an HTTP error and should_raise is False
200
201
  """
201
202
  validation_only = request_options["validation_only"]
202
- async with self.semaphore:
203
+ bulk_semaphore = asyncio.Semaphore(ENTITIES_BULK_UPSERT_CONCURRENCY)
204
+ async with bulk_semaphore:
203
205
  logger.debug(
204
206
  f"{'Validating' if validation_only else 'Upserting'} {len(entities)} of blueprint: {blueprint}"
205
207
  )
@@ -378,7 +380,7 @@ class EntityClientMixin:
378
380
  ):
379
381
  if should_raise:
380
382
  raise bulk_result
381
- # If should_raise is False, retry batch in sequential order as a fallback only for 413 errors
383
+ # If should_raise is False, retry bulk in sequential order as a fallback only for 413 errors
382
384
  if (
383
385
  isinstance(bulk_result, httpx.HTTPStatusError)
384
386
  and bulk_result.response.status_code == 413
@@ -325,7 +325,11 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
325
325
  )
326
326
 
327
327
  passed_entities = []
328
+ number_of_raw_results = 0
329
+ number_of_transformed_entities = 0
330
+
328
331
  if raw_results:
332
+ number_of_raw_results += len(raw_results)
329
333
  calculation_result = await self._register_resource_raw(
330
334
  resource_config,
331
335
  raw_results,
@@ -334,12 +338,13 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
334
338
  )
335
339
  errors.extend(calculation_result.errors)
336
340
  passed_entities = list(calculation_result.entity_selector_diff.passed)
341
+ number_of_transformed_entities += calculation_result.number_of_transformed_entities
337
342
  logger.info(
338
343
  f"Finished registering change for {len(raw_results)} raw results for kind: {resource_config.kind}. {len(passed_entities)} entities were affected"
339
344
  )
340
345
 
341
- number_of_raw_results = 0
342
- number_of_transformed_entities = 0
346
+
347
+
343
348
  for generator in async_generators:
344
349
  try:
345
350
  async for items in generator:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.24.12
3
+ Version: 0.24.15
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
@@ -59,7 +59,7 @@ port_ocean/clients/port/authentication.py,sha256=r7r8Ag9WuwXy-CmgeOoj-PHbmJAQxhb
59
59
  port_ocean/clients/port/client.py,sha256=dv0mxIOde6J-wFi1FXXZkoNPVHrZzY7RSMhNkDD9xgA,3566
60
60
  port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
61
  port_ocean/clients/port/mixins/blueprints.py,sha256=aMCG4zePsMSMjMLiGrU37h5z5_ElfMzTcTvqvOI5wXY,4683
62
- port_ocean/clients/port/mixins/entities.py,sha256=NSZCV-IAg5_gQ7LxCMzxKJu_LkFkz809CQ2y8dFhHqE,23239
62
+ port_ocean/clients/port/mixins/entities.py,sha256=_FKoSEUxc_fGcdoWm4ZAeUKUnnzkGPMDQEsxmpbj8Vo,23352
63
63
  port_ocean/clients/port/mixins/integrations.py,sha256=s6paomK9bYWW-Tu3y2OIaEGSxsXCHyhapVi4JIhhO64,11162
64
64
  port_ocean/clients/port/mixins/migrations.py,sha256=vdL_A_NNUogvzujyaRLIoZEu5vmKDY2BxTjoGP94YzI,1467
65
65
  port_ocean/clients/port/mixins/organization.py,sha256=A2cP5V49KnjoAXxjmnm_XGth4ftPSU0qURNfnyUyS_Y,1041
@@ -121,7 +121,7 @@ port_ocean/core/integrations/mixins/events.py,sha256=2L7P3Jhp8XBqddh2_o9Cn4N261n
121
121
  port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
122
122
  port_ocean/core/integrations/mixins/live_events.py,sha256=zM24dhNc7uHx9XYZ6toVhDADPA90EnpOmZxgDegFZbA,4196
123
123
  port_ocean/core/integrations/mixins/sync.py,sha256=Vm_898pLKBwfVewtwouDWsXoxcOLicnAy6pzyqqk6U8,4053
124
- port_ocean/core/integrations/mixins/sync_raw.py,sha256=AtS0Qr4mIY3vZZxSmnFOLMskiQ_kJUg0_f2ZT8O_Ejw,33670
124
+ port_ocean/core/integrations/mixins/sync_raw.py,sha256=0wFpyWSlKREIb3BNfkUg1Tj6ueivsig2YjPmYchb-mY,33823
125
125
  port_ocean/core/integrations/mixins/utils.py,sha256=N76dNu1Y6UEg0_pcSdF4RO6dQIZ8EBfX3xMelgWdMxM,3779
126
126
  port_ocean/core/models.py,sha256=DNbKpStMINI2lIekKprTqBevqkw_wFuFayN19w1aDfQ,2893
127
127
  port_ocean/core/ocean_types.py,sha256=4VipWFOHEh_d9LmWewQccwx1p2dtrRYW0YURVgNsAjo,1398
@@ -200,8 +200,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
200
200
  port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
201
201
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
202
202
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
203
- port_ocean-0.24.12.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
204
- port_ocean-0.24.12.dist-info/METADATA,sha256=M9cpzpsS5jK2RWZDtkAC7aaDguwKpNQM4YRSPiuchiA,6856
205
- port_ocean-0.24.12.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
206
- port_ocean-0.24.12.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
207
- port_ocean-0.24.12.dist-info/RECORD,,
203
+ port_ocean-0.24.15.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
204
+ port_ocean-0.24.15.dist-info/METADATA,sha256=TtYkoKWtDtuca9sk3RX0VeC4msD0SPnXbW-V-ppjznY,6856
205
+ port_ocean-0.24.15.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
206
+ port_ocean-0.24.15.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
207
+ port_ocean-0.24.15.dist-info/RECORD,,