Skip to content

Commit 4223050

Browse files
No0b1t0Arik Gortsunianmatan84
authored
[Core] Adjust jq mapping log - terminology and counter (#1291)
# Description What - - Adjusted log teminology - Faild transformations counter increments for all cases (None (null / missing), empty) Why - the terminology of the log was not clear enough ## Type of change Please leave one option from the following and delete the rest: - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] New Integration (non-breaking change which adds a new integration) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Non-breaking change (fix of existing functionality that will not change current behavior) - [ ] Documentation (added/updated documentation) --------- Co-authored-by: Arik Gortsunian <agorts@Ariks-MacBook-Pro.local> Co-authored-by: Matan <51418643+matan84@users.noreply.github.com>
1 parent 70063e2 commit 4223050

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
<!-- towncrier release notes start -->
9+
## 0.17.4 (2024-12-31)
10+
11+
12+
### Bug Fixes
13+
14+
- Adjusted log terminology
15+
- Failed transformations counter now increments for all cases (None (null / missing), empty)
16+
917
## 0.17.3 (2024-12-31)
1018

1119

port_ocean/core/handlers/entity_processor/jq_entity_processor.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _notify_mapping_issues(
7878
)
7979
if missing_required_fields:
8080
logger.info(
81-
f"{entity_mapping_fault_counter} transformations of batch failed due to empty values"
81+
f"{entity_mapping_fault_counter} transformations of batch failed due to empty, null or missing values"
8282
)
8383

8484
async def _search(self, data: dict[str, Any], pattern: str) -> Any:
@@ -286,15 +286,7 @@ async def _parse_items(
286286
failed_entities.append(parsed_entity)
287287
else:
288288
missing_required_fields = True
289-
if (result.entity.get("identifier") == "") or (
290-
result.entity.get("blueprint") == ""
291-
):
292-
entity_mapping_fault_counter += 1
293-
else:
294-
logger.debug(
295-
f"Mapping failed, values verification for identifier: {result.entity.get("identifier")}, \
296-
for blueprint: {result.entity.get("blueprint")}"
297-
)
289+
entity_mapping_fault_counter += 1
298290

299291
self._notify_mapping_issues(
300292
entity_misconfigurations,

port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,11 @@ async def test_parse_items_empty_required(
340340
logger.remove(sink_id)
341341
logs_captured = stream.getvalue()
342342

343-
assert "2 transformations of batch failed due to empty values" in logs_captured
343+
assert (
344+
"2 transformations of batch failed due to empty, null or missing values"
345+
in logs_captured
346+
)
344347
assert (
345348
"{'blueprint': '.bar', 'identifier': '.foo'} (null, missing, or misconfigured)"
346349
in logs_captured
347350
)
348-
assert "1 transformations of batch failed due to empty values" in logs_captured

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "port-ocean"
3-
version = "0.17.3"
3+
version = "0.17.4"
44
description = "Port Ocean is a CLI tool for managing your Port projects."
55
readme = "README.md"
66
homepage = "https://app.getport.io"

0 commit comments

Comments
 (0)