port-ocean 0.7.0__py3-none-any.whl → 0.8.0__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/handlers/entity_processor/jq_entity_processor.py +11 -3
- port_ocean/core/handlers/port_app_config/models.py +18 -4
- port_ocean/core/integrations/mixins/sync_raw.py +4 -1
- {port_ocean-0.7.0.dist-info → port_ocean-0.8.0.dist-info}/METADATA +1 -1
- {port_ocean-0.7.0.dist-info → port_ocean-0.8.0.dist-info}/RECORD +8 -8
- {port_ocean-0.7.0.dist-info → port_ocean-0.8.0.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.7.0.dist-info → port_ocean-0.8.0.dist-info}/WHEEL +0 -0
- {port_ocean-0.7.0.dist-info → port_ocean-0.8.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import functools
|
|
3
|
+
from asyncio import Task
|
|
3
4
|
from dataclasses import dataclass, field
|
|
4
5
|
from functools import lru_cache
|
|
5
6
|
from typing import Any, Optional
|
|
@@ -70,9 +71,13 @@ class JQEntityProcessor(BaseEntityProcessor):
|
|
|
70
71
|
async def _search_as_object(
|
|
71
72
|
self, data: dict[str, Any], obj: dict[str, Any]
|
|
72
73
|
) -> dict[str, Any | None]:
|
|
73
|
-
search_tasks = {}
|
|
74
|
+
search_tasks: dict[str,Task[dict[str,Any | None]] | list[Task[dict[str,Any | None]]]] = {}
|
|
74
75
|
for key, value in obj.items():
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
if isinstance(value,list):
|
|
78
|
+
search_tasks[key] = [asyncio.create_task(self._search_as_object(data,obj)) for obj in value]
|
|
79
|
+
|
|
80
|
+
elif isinstance(value, dict):
|
|
76
81
|
search_tasks[key] = asyncio.create_task(
|
|
77
82
|
self._search_as_object(data, value)
|
|
78
83
|
)
|
|
@@ -82,7 +87,10 @@ class JQEntityProcessor(BaseEntityProcessor):
|
|
|
82
87
|
result: dict[str, Any | None] = {}
|
|
83
88
|
for key, task in search_tasks.items():
|
|
84
89
|
try:
|
|
85
|
-
|
|
90
|
+
if isinstance(task,list):
|
|
91
|
+
result[key] = [await task for task in task]
|
|
92
|
+
else:
|
|
93
|
+
result[key] = await task
|
|
86
94
|
except Exception:
|
|
87
95
|
result[key] = None
|
|
88
96
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from typing import Any
|
|
2
4
|
|
|
3
5
|
from pydantic import BaseModel, Field
|
|
@@ -5,19 +7,31 @@ from pydantic import BaseModel, Field
|
|
|
5
7
|
from port_ocean.clients.port.types import RequestOptions
|
|
6
8
|
|
|
7
9
|
|
|
10
|
+
class Rule(BaseModel):
|
|
11
|
+
property: str
|
|
12
|
+
operator: str
|
|
13
|
+
value: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SearchRelation(BaseModel):
|
|
17
|
+
combinator: str
|
|
18
|
+
rules: list[Rule | SearchRelation]
|
|
19
|
+
|
|
20
|
+
|
|
8
21
|
class EntityMapping(BaseModel):
|
|
9
22
|
identifier: str
|
|
10
23
|
title: str | None
|
|
11
24
|
blueprint: str
|
|
12
25
|
team: str | None
|
|
13
26
|
properties: dict[str, str] = Field(default_factory=dict)
|
|
14
|
-
relations: dict[str, str] = Field(default_factory=dict)
|
|
27
|
+
relations: dict[str, str | SearchRelation] = Field(default_factory=dict)
|
|
15
28
|
|
|
16
29
|
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
mappings: EntityMapping
|
|
30
|
+
class MappingsConfig(BaseModel):
|
|
31
|
+
mappings: EntityMapping
|
|
20
32
|
|
|
33
|
+
|
|
34
|
+
class PortResourceConfig(BaseModel):
|
|
21
35
|
entity: MappingsConfig
|
|
22
36
|
items_to_parse: str | None = Field(alias="itemsToParse")
|
|
23
37
|
|
|
@@ -238,7 +238,7 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
238
238
|
return []
|
|
239
239
|
|
|
240
240
|
diffs, errors = zip(
|
|
241
|
-
await asyncio.gather(
|
|
241
|
+
*await asyncio.gather(
|
|
242
242
|
*(
|
|
243
243
|
self._register_resource_raw(
|
|
244
244
|
resource, results, user_agent_type, True
|
|
@@ -248,6 +248,9 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
248
248
|
)
|
|
249
249
|
)
|
|
250
250
|
|
|
251
|
+
diffs = list(diffs)
|
|
252
|
+
errors = sum(errors, [])
|
|
253
|
+
|
|
251
254
|
if errors:
|
|
252
255
|
message = f"Failed to register {len(errors)} entities. Skipping delete phase due to incomplete state"
|
|
253
256
|
logger.error(message, exc_info=errors)
|
|
@@ -77,18 +77,18 @@ port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py,sha
|
|
|
77
77
|
port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py,sha256=82BvU8t5w9uhsxX8hbnwuRPuWhW3cMeuT_5sVIkip1I,1550
|
|
78
78
|
port_ocean/core/handlers/entity_processor/__init__.py,sha256=FvFCunFg44wNQoqlybem9MthOs7p1Wawac87uSXz9U8,156
|
|
79
79
|
port_ocean/core/handlers/entity_processor/base.py,sha256=udR0w5TstTOS5xOfTjAZIEdldn4xr6Oyb3DylatYX3Q,1869
|
|
80
|
-
port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=
|
|
80
|
+
port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=BU-kRUDnTVJNpa-B_Z6LQFuHanh9J9-2NluHavniYDM,7712
|
|
81
81
|
port_ocean/core/handlers/port_app_config/__init__.py,sha256=8AAT5OthiVM7KCcM34iEgEeXtn2pRMrT4Dze5r1Ixbk,134
|
|
82
82
|
port_ocean/core/handlers/port_app_config/api.py,sha256=6VbKPwFzsWG0IYsVD81hxSmfqtHUFqrfUuj1DBX5g4w,853
|
|
83
83
|
port_ocean/core/handlers/port_app_config/base.py,sha256=oufdNLzUmEgJY5PgIz75zDlowWrjA-y8WR4UnM58E58,2897
|
|
84
|
-
port_ocean/core/handlers/port_app_config/models.py,sha256=
|
|
84
|
+
port_ocean/core/handlers/port_app_config/models.py,sha256=4dw6HbgjMG3advpN3x6XF35xsgScnWm0KKTERG4CYZ8,2201
|
|
85
85
|
port_ocean/core/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
port_ocean/core/integrations/base.py,sha256=KHsRYFZ38ff3AkkqIQu45883ovgKOJn_fZfnTNy7HWY,2952
|
|
87
87
|
port_ocean/core/integrations/mixins/__init__.py,sha256=FA1FEKMM6P-L2_m7Q4L20mFa4_RgZnwSRmTCreKcBVM,220
|
|
88
88
|
port_ocean/core/integrations/mixins/events.py,sha256=Ddfx2L4FpghV38waF8OfVeOV0bHBxNIgjU-q5ffillI,2341
|
|
89
89
|
port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
|
|
90
90
|
port_ocean/core/integrations/mixins/sync.py,sha256=TKqRytxXONVhuCo3CB3rDvWNbITnZz33TYTDs3SWWVk,3880
|
|
91
|
-
port_ocean/core/integrations/mixins/sync_raw.py,sha256=
|
|
91
|
+
port_ocean/core/integrations/mixins/sync_raw.py,sha256=yFORznT6TXX7SXP1sSoHAjLxmjDzXIr3Vu-plbhLBoA,18017
|
|
92
92
|
port_ocean/core/integrations/mixins/utils.py,sha256=7y1rGETZIjOQadyIjFJXIHKkQFKx_SwiP-TrAIsyyLY,2303
|
|
93
93
|
port_ocean/core/models.py,sha256=YPIU7V3GKeDXIVkNzZn0w17YN2Akl-D8nFs-l4bEKcU,1143
|
|
94
94
|
port_ocean/core/ocean_types.py,sha256=3_d8-n626f1kWLQ_Jxw194LEyrOVupz05qs_Y1pvB-A,990
|
|
@@ -122,8 +122,8 @@ port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwz
|
|
|
122
122
|
port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,3231
|
|
123
123
|
port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
|
|
124
124
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
125
|
-
port_ocean-0.
|
|
126
|
-
port_ocean-0.
|
|
127
|
-
port_ocean-0.
|
|
128
|
-
port_ocean-0.
|
|
129
|
-
port_ocean-0.
|
|
125
|
+
port_ocean-0.8.0.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
126
|
+
port_ocean-0.8.0.dist-info/METADATA,sha256=b12SkmpuVSjxM8ASdLd4VBJS1h1igcll5UInwEggHNY,6561
|
|
127
|
+
port_ocean-0.8.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
128
|
+
port_ocean-0.8.0.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
129
|
+
port_ocean-0.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|