[Core] Fix JQ Transform Failures Caused By Datetime And Date Values#3046
[Core] Fix JQ Transform Failures Caused By Datetime And Date Values#3046emekanwaoma merged 6 commits intomainfrom
Conversation
Review Summary by QodoFix JQ transform failures from datetime and date values
WalkthroughsDescription• Add make_json_compatible() utility to normalize date/datetime to ISO strings • Apply normalization in JQ processors before passing data to jq • Prevents JSON serialization failures from Python-native date/datetime values • Add comprehensive unit tests for the normalizer function Diagramflowchart LR
A["Raw Data with<br/>date/datetime"] -->|make_json_compatible| B["JSON-compatible<br/>ISO strings"]
B -->|input_value| C["JQ Processor"]
C -->|Success| D["Mapped Entity"]
File Changes1. port_ocean/core/utils/json_compat.py
|
Code Review by Qodo
1.
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/23948158664/artifacts/6260379203Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/23997195562/artifacts/6276111613Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/23997276483/artifacts/6276136915Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/23997337011/artifacts/6276151962Code Coverage Total Percentage:
|
port_ocean/core/utils/json_compat.py
Outdated
| return value | ||
|
|
||
|
|
||
| def jq_input_value(compiled_pattern: Any, data: Any) -> Any: |
There was a problem hiding this comment.
| def jq_input_value(compiled_pattern: Any, data: Any) -> Any: | |
| def compile_jq(compiled_pattern: Any, data: Any) -> Any: |
pyproject.toml
Outdated
| [tool.poetry] | ||
| name = "port-ocean" | ||
| version = "0.38.27" | ||
| version = "0.38.28" |
There was a problem hiding this comment.
| version = "0.38.28" | |
| version = "0.39.0" |
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/23997829024/artifacts/6276296135Code Coverage Total Percentage:
|
Description
What -
Why -
Improve reliability across all integrations without requiring per-integration workarounds.
How -
Efficiency note: This is the most efficient long-term approach because it centralizes the fix in Ocean core at the single JQ boundary (covering all integrations/mappings) and avoids scattered per-integration parsing changes or expensive serialize→parse workarounds.
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examplesfolder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.