port-ocean 0.5.24.dev1__py3-none-any.whl → 0.5.27__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/config/settings.py +9 -9
- port_ocean/core/defaults/initialize.py +1 -1
- port_ocean/core/integrations/mixins/sync_raw.py +9 -2
- port_ocean/core/utils.py +11 -5
- port_ocean/exceptions/port_defaults.py +1 -1
- {port_ocean-0.5.24.dev1.dist-info → port_ocean-0.5.27.dist-info}/METADATA +1 -1
- {port_ocean-0.5.24.dev1.dist-info → port_ocean-0.5.27.dist-info}/RECORD +10 -10
- {port_ocean-0.5.24.dev1.dist-info → port_ocean-0.5.27.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.5.24.dev1.dist-info → port_ocean-0.5.27.dist-info}/WHEEL +0 -0
- {port_ocean-0.5.24.dev1.dist-info → port_ocean-0.5.27.dist-info}/entry_points.txt +0 -0
port_ocean/config/settings.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
from typing import Any, Literal
|
|
2
2
|
|
|
3
|
+
from port_ocean.config.base import BaseOceanSettings, BaseOceanModel
|
|
4
|
+
from port_ocean.core.event_listener import EventListenerSettingsType
|
|
5
|
+
from port_ocean.utils.misc import get_integration_name
|
|
3
6
|
from pydantic import Extra, AnyHttpUrl, parse_obj_as
|
|
4
7
|
from pydantic.class_validators import root_validator
|
|
5
8
|
from pydantic.env_settings import InitSettingsSource, EnvSettingsSource, BaseSettings
|
|
6
9
|
from pydantic.fields import Field
|
|
7
10
|
from pydantic.main import BaseModel
|
|
8
11
|
|
|
9
|
-
from port_ocean.config.base import BaseOceanSettings, BaseOceanModel
|
|
10
|
-
from port_ocean.core.event_listener import EventListenerSettingsType
|
|
11
|
-
from port_ocean.utils.misc import get_integration_name
|
|
12
|
-
|
|
13
12
|
LogLevelType = Literal["ERROR", "WARNING", "INFO", "DEBUG", "CRITICAL"]
|
|
14
13
|
|
|
15
14
|
|
|
@@ -42,12 +41,12 @@ class PortSettings(BaseOceanModel, extra=Extra.allow):
|
|
|
42
41
|
|
|
43
42
|
|
|
44
43
|
class IntegrationSettings(BaseOceanModel, extra=Extra.allow):
|
|
45
|
-
identifier: str
|
|
46
|
-
type: str
|
|
47
|
-
config: dict[str, Any] | BaseModel
|
|
44
|
+
identifier: str
|
|
45
|
+
type: str
|
|
46
|
+
config: dict[str, Any] | BaseModel = Field(default_factory=dict)
|
|
48
47
|
|
|
49
48
|
@root_validator(pre=True)
|
|
50
|
-
def
|
|
49
|
+
def root_validator(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
51
50
|
integ_type = values.get("type")
|
|
52
51
|
|
|
53
52
|
if not integ_type:
|
|
@@ -68,4 +67,5 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
|
|
|
68
67
|
send_raw_data_examples: bool = True
|
|
69
68
|
port: PortSettings
|
|
70
69
|
event_listener: EventListenerSettingsType
|
|
71
|
-
integration
|
|
70
|
+
# If an identifier or type is not provided, it will be generated based on the integration name
|
|
71
|
+
integration: IntegrationSettings = IntegrationSettings(type="", identifier="")
|
|
@@ -159,7 +159,7 @@ async def _create_resources(
|
|
|
159
159
|
f"Failed to create resources: {err.response.text}. Rolling back changes..."
|
|
160
160
|
)
|
|
161
161
|
raise AbortDefaultCreationError(
|
|
162
|
-
created_blueprints_identifiers, [err],
|
|
162
|
+
created_blueprints_identifiers, [err], created_pages_identifiers
|
|
163
163
|
)
|
|
164
164
|
|
|
165
165
|
|
|
@@ -372,7 +372,10 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
372
372
|
)
|
|
373
373
|
|
|
374
374
|
if after_errors:
|
|
375
|
-
message =
|
|
375
|
+
message = (
|
|
376
|
+
f"Failed to calculate diff for entities with {len(after_errors)} errors. "
|
|
377
|
+
f"Skipping delete phase due to incomplete state"
|
|
378
|
+
)
|
|
376
379
|
logger.error(message, exc_info=after_errors)
|
|
377
380
|
entities_before_flatten = []
|
|
378
381
|
|
|
@@ -416,7 +419,11 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
416
419
|
)
|
|
417
420
|
except httpx.HTTPError as e:
|
|
418
421
|
logger.warning(
|
|
419
|
-
"Failed to fetch the current state of entities at Port.
|
|
422
|
+
"Failed to fetch the current state of entities at Port. "
|
|
423
|
+
"Skipping delete phase due to unknown initial state. "
|
|
424
|
+
f"Error: {e}\n"
|
|
425
|
+
f"Response status code: {e.response.status_code if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
426
|
+
f"Response content: {e.response.text if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
420
427
|
)
|
|
421
428
|
entities_at_port = []
|
|
422
429
|
|
port_ocean/core/utils.py
CHANGED
|
@@ -34,13 +34,19 @@ Q = TypeVar("Q")
|
|
|
34
34
|
|
|
35
35
|
async def gather_and_split_errors_from_results(
|
|
36
36
|
task: Iterable[Awaitable[Q]],
|
|
37
|
-
result_threshold_validation: Callable[[Q |
|
|
38
|
-
) -> tuple[list[Q], list[
|
|
39
|
-
valid_items = []
|
|
40
|
-
errors = []
|
|
37
|
+
result_threshold_validation: Callable[[Q | Exception], bool] | None = None,
|
|
38
|
+
) -> tuple[list[Q], list[Exception]]:
|
|
39
|
+
valid_items: list[Q] = []
|
|
40
|
+
errors: list[Exception] = []
|
|
41
41
|
results = await asyncio.gather(*task, return_exceptions=True)
|
|
42
42
|
for item in results:
|
|
43
|
-
|
|
43
|
+
# return_exceptions will also catch Python BaseException which also includes KeyboardInterrupt, SystemExit, GeneratorExit
|
|
44
|
+
# https://docs.python.org/3/library/asyncio-task.html#asyncio.gather
|
|
45
|
+
# These exceptions should be raised and not caught for the application to exit properly.
|
|
46
|
+
# https://stackoverflow.com/a/17802352
|
|
47
|
+
if isinstance(item, BaseException) and not isinstance(item, Exception):
|
|
48
|
+
raise item
|
|
49
|
+
elif isinstance(item, Exception):
|
|
44
50
|
errors.append(item)
|
|
45
51
|
elif not result_threshold_validation or result_threshold_validation(item):
|
|
46
52
|
valid_items.append(item)
|
|
@@ -5,7 +5,7 @@ class AbortDefaultCreationError(BaseOceanException):
|
|
|
5
5
|
def __init__(
|
|
6
6
|
self,
|
|
7
7
|
blueprints_to_rollback: list[str],
|
|
8
|
-
errors: list[
|
|
8
|
+
errors: list[Exception],
|
|
9
9
|
pages_to_rollback: list[str] | None = None,
|
|
10
10
|
):
|
|
11
11
|
self.blueprints_to_rollback = blueprints_to_rollback
|
|
@@ -48,7 +48,7 @@ port_ocean/clients/port/utils.py,sha256=O9mBu6zp4TfpS4SQ3qCPpn9ZVyYF8GKnji4UnYhM
|
|
|
48
48
|
port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
port_ocean/config/base.py,sha256=J_FUvlo0D4FbEbr4mgJsbGB5JjW9I7zMwfekj6T30KY,6389
|
|
50
50
|
port_ocean/config/dynamic.py,sha256=qOFkRoJsn_BW7581omi_AoMxoHqasf_foxDQ_G11_SI,2030
|
|
51
|
-
port_ocean/config/settings.py,sha256=
|
|
51
|
+
port_ocean/config/settings.py,sha256=f6BXxFyu92WYhfPw4wlRaZ6jhkEsxhjw_BiWN9RERZg,2441
|
|
52
52
|
port_ocean/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
port_ocean/consumers/kafka_consumer.py,sha256=N8KocjBi9aR0BOPG8hgKovg-ns_ggpEjrSxqSqF_BSo,4710
|
|
54
54
|
port_ocean/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -59,7 +59,7 @@ port_ocean/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
59
59
|
port_ocean/core/defaults/__init__.py,sha256=8qCZg8n06WAdMu9s_FiRtDYLGPGHbOuS60vapeUoAks,142
|
|
60
60
|
port_ocean/core/defaults/clean.py,sha256=S3UAfca-oU89WJKIB4OgGjGjPr0vxBQ2aRZsLTZhQ04,2185
|
|
61
61
|
port_ocean/core/defaults/common.py,sha256=QnLFTkT3yIWIRtLQb7fUvvfe5AfInYJy0q5LjlzHkOw,3553
|
|
62
|
-
port_ocean/core/defaults/initialize.py,sha256=
|
|
62
|
+
port_ocean/core/defaults/initialize.py,sha256=Cm1QFO7CLoPDdbJVYycbkWlfJfq7hlGbdRj49clBNUM,7432
|
|
63
63
|
port_ocean/core/event_listener/__init__.py,sha256=mzJ33wRq0kh60fpVdOHVmvMTUQIvz3vxmifyBgwDn0E,889
|
|
64
64
|
port_ocean/core/event_listener/base.py,sha256=4RujgPz4VfDFlviu4qLGJFnJougSCL-Ewf0rfTQfwgc,1133
|
|
65
65
|
port_ocean/core/event_listener/factory.py,sha256=AYYfSHPAF7P5H-uQECXT0JVJjKDHrYkWJJBSL4mGkg8,3697
|
|
@@ -88,18 +88,18 @@ port_ocean/core/integrations/mixins/__init__.py,sha256=FA1FEKMM6P-L2_m7Q4L20mFa4
|
|
|
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=GmH5YPVnYO6mKEhoRer9F-vYy8mxPspaSWw2y9JJhgc,17954
|
|
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
|
|
95
|
-
port_ocean/core/utils.py,sha256=
|
|
95
|
+
port_ocean/core/utils.py,sha256=5ISNJ90xxK4Nf_suGEZ2ZPBKsoOqL7khU0MuA0q5zmE,2891
|
|
96
96
|
port_ocean/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
97
|
port_ocean/exceptions/api.py,sha256=TLmTMqn4uHGaHgZK8PMIJ0TVJlPB4iP7xl9rx7GtCyY,426
|
|
98
98
|
port_ocean/exceptions/base.py,sha256=uY4DX7fIITDFfemCJDWpaZi3bD51lcANc5swpoNvMJA,46
|
|
99
99
|
port_ocean/exceptions/clients.py,sha256=LKLLs-Zy3caNG85rwxfOw2rMr8qqVV6SHUq4fRCZ99U,180
|
|
100
100
|
port_ocean/exceptions/context.py,sha256=mA8HII6Rl4QxKUz98ppy1zX3kaziaen21h1ZWuU3ADc,372
|
|
101
101
|
port_ocean/exceptions/core.py,sha256=ygxtPQ9IG8NzIrzZok5OqkefVrqcC4bjZ-2Vf9IPZuA,790
|
|
102
|
-
port_ocean/exceptions/port_defaults.py,sha256=
|
|
102
|
+
port_ocean/exceptions/port_defaults.py,sha256=pJ5im06ziDX2IVstSlYIjVHhs4JW-N0Vr0PqlDNhAb4,541
|
|
103
103
|
port_ocean/exceptions/utils.py,sha256=gjOqpi-HpY1l4WlMFsGA9yzhxDhajhoGGdDDyGbLnqI,197
|
|
104
104
|
port_ocean/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
105
|
port_ocean/helpers/async_client.py,sha256=SRlP6o7_FCSY3UHnRlZdezppePVxxOzZ0z861vE3K40,1783
|
|
@@ -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.5.
|
|
126
|
-
port_ocean-0.5.
|
|
127
|
-
port_ocean-0.5.
|
|
128
|
-
port_ocean-0.5.
|
|
129
|
-
port_ocean-0.5.
|
|
125
|
+
port_ocean-0.5.27.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
126
|
+
port_ocean-0.5.27.dist-info/METADATA,sha256=FoY4jR5sOhpMQ9I42YySx6xk1ejb_Fk8OiByuTcNP6k,6554
|
|
127
|
+
port_ocean-0.5.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
128
|
+
port_ocean-0.5.27.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
129
|
+
port_ocean-0.5.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|