Skip to content

Commit

Permalink
improved logs & bump
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Jun 27, 2024
1 parent 8dee880 commit 013adab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 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 @@ -61,13 +61,13 @@ async def _search(self, data: dict[str, Any], pattern: str) -> Any:
)
result = await loop.run_in_executor(None, first_value_callable)
logger.info(
f"__FINISHED__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
f"__FINISHED__ jq execution with pattern: {pattern}. trace-id: {identifier} \n"
f"Result {result}"
)
return result
except Exception as e:
logger.error(
f"__FAILED__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
f"__FAILED__ jq execution with pattern: {pattern}. trace-id: {identifier} \n"
f"Error {e}"
)
return None
Expand All @@ -86,19 +86,21 @@ async def _search_as_bool(self, data: dict[str, Any], pattern: str) -> bool:
)
value = await loop.run_in_executor(None, first_value_callable)
logger.info(
f"__FINISHED_BOOL__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
f"__FINISHED_BOOL__ jq execution with pattern: {pattern}. trace-id: {identifier} \n"
f"Result {value}"
)
except Exception as e:
logger.error(
f"__FAILED_BOOL__ jq execution with pattern: {pattern} and data: {data}. trace-id: {identifier} \n"
f"__FAILED_BOOL__ jq execution with pattern: {pattern}. trace-id: {identifier} \n"
f"Error {e}"
)
raise

if isinstance(value, bool):
return value

logger.error(
f"__FAILED_BOOL__ jq execution with pattern: {pattern}. Invalid type got {type(value)} instead. trace-id: {identifier}"
)
raise EntityProcessorException(
f"Expected boolean value, got {type(value)} instead"
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.9.2-dev01"
version = "0.9.2-dev02"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit 013adab

Please sign in to comment.