port-ocean 0.9.1__py3-none-any.whl → 0.9.2.dev1__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.
@@ -4,6 +4,7 @@ from asyncio import Task
4
4
  from dataclasses import dataclass, field
5
5
  from functools import lru_cache
6
6
  from typing import Any, Optional
7
+ from uuid import uuid4
7
8
 
8
9
  import pyjq as jq # type: ignore
9
10
  from loguru import logger
@@ -47,19 +48,53 @@ class JQEntityProcessor(BaseEntityProcessor):
47
48
  return jq.compile(pattern)
48
49
 
49
50
  async def _search(self, data: dict[str, Any], pattern: str) -> Any:
51
+ identifier = str(uuid4())
50
52
  try:
51
53
  loop = asyncio.get_event_loop()
54
+ logger.info(
55
+ f"__COMPILING__ jq execution with pattern: {pattern}. trace-id: {identifier}"
56
+ )
52
57
  compiled_pattern = self._compile(pattern)
53
58
  first_value_callable = functools.partial(compiled_pattern.first, data)
54
- return await loop.run_in_executor(None, first_value_callable)
55
- except Exception:
59
+ logger.info(
60
+ f"__STARTING__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier}"
61
+ )
62
+ result = await loop.run_in_executor(None, first_value_callable)
63
+ logger.info(
64
+ f"__FINISHED__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
65
+ f"Result {result}"
66
+ )
67
+ return result
68
+ except Exception as e:
69
+ logger.error(
70
+ f"__FAILED__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
71
+ f"Error {e}"
72
+ )
56
73
  return None
57
74
 
58
75
  async def _search_as_bool(self, data: dict[str, Any], pattern: str) -> bool:
59
76
  loop = asyncio.get_event_loop()
60
- compiled_pattern = self._compile(pattern)
61
- first_value_callable = functools.partial(compiled_pattern.first, data)
62
- value = await loop.run_in_executor(None, first_value_callable)
77
+ identifier = str(uuid4())
78
+ try:
79
+ logger.info(
80
+ f"__COMPILING_BOOL__ jq execution with pattern: {pattern}. trace-id: {identifier}"
81
+ )
82
+ compiled_pattern = self._compile(pattern)
83
+ first_value_callable = functools.partial(compiled_pattern.first, data)
84
+ logger.info(
85
+ f"__STARTING_BOOL__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier}"
86
+ )
87
+ value = await loop.run_in_executor(None, first_value_callable)
88
+ logger.info(
89
+ f"__FINISHED_BOOL__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
90
+ f"Result {value}"
91
+ )
92
+ except Exception as e:
93
+ logger.error(
94
+ f"__FAILED_BOOL__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
95
+ f"Error {e}"
96
+ )
97
+ raise
63
98
 
64
99
  if isinstance(value, bool):
65
100
  return value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.9.1
3
+ Version: 0.9.2.dev1
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
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Classifier: Topic :: Utilities
23
23
  Provides-Extra: cli
24
- Requires-Dist: aiostream (>=0.5.2,<0.6.0)
24
+ Requires-Dist: aiostream (>=0.5.2,<0.7.0)
25
25
  Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
26
26
  Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
27
27
  Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
@@ -77,7 +77,7 @@ 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=uVHclCctUS3FGSCBLWD8Mesqttv-ege-X6K5o94zVOc,7797
80
+ port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=Ra6Gtv0VKa0VTj2ymcn1XDE1_8DNx6Soo2-oZi7Qo5g,9312
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
@@ -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.9.1.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
126
- port_ocean-0.9.1.dist-info/METADATA,sha256=PRjfspeABVsgg4gcPiaSSNnBITeqLQS3mzYKE9J7Ldk,6561
127
- port_ocean-0.9.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
128
- port_ocean-0.9.1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
129
- port_ocean-0.9.1.dist-info/RECORD,,
125
+ port_ocean-0.9.2.dev1.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
126
+ port_ocean-0.9.2.dev1.dist-info/METADATA,sha256=ObC0NM-3CS4aTOulc8e_by_8C59mU0hG6NX18Sa0CTY,6566
127
+ port_ocean-0.9.2.dev1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
128
+ port_ocean-0.9.2.dev1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
129
+ port_ocean-0.9.2.dev1.dist-info/RECORD,,