Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Shalev Avhar committed Jun 16, 2024
1 parent 14161d8 commit 685cb02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions port_ocean/core/event_listener/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class KafkaEventListenerSettings(EventListenerSettings):
"""

type: Literal["KAFKA"]
brokers: str = (
"b-1-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-2-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-3-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196"
)
brokers: str = "b-1-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-2-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-3-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196"
security_protocol: str = "SASL_SSL"
authentication_mechanism: str = "SCRAM-SHA-512"
kafka_security_enabled: bool = True
Expand Down
14 changes: 9 additions & 5 deletions port_ocean/core/handlers/entity_processor/jq_entity_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ async def _search_as_bool(self, data: dict[str, Any], pattern: str) -> bool:
async def _search_as_object(
self, data: dict[str, Any], obj: dict[str, Any]
) -> dict[str, Any | None]:
search_tasks: dict[str,Task[dict[str,Any | None]] | list[Task[dict[str,Any | None]]]] = {}
search_tasks: dict[
str, Task[dict[str, Any | None]] | list[Task[dict[str, Any | None]]]
] = {}
for key, value in obj.items():

if isinstance(value,list):
search_tasks[key] = [asyncio.create_task(self._search_as_object(data,obj)) for obj in value]
if isinstance(value, list):
search_tasks[key] = [
asyncio.create_task(self._search_as_object(data, obj))
for obj in value
]

elif isinstance(value, dict):
search_tasks[key] = asyncio.create_task(
Expand All @@ -87,7 +91,7 @@ async def _search_as_object(
result: dict[str, Any | None] = {}
for key, task in search_tasks.items():
try:
if isinstance(task,list):
if isinstance(task, list):
result[key] = [await task for task in task]
else:
result[key] = await task
Expand Down

0 comments on commit 685cb02

Please sign in to comment.