Skip to content

Commit b9e9624

Browse files
authored
Backport Stable in Develop (#40)
* Port CICD changes to `main` (#27) * Check if transform_value exists
1 parent a853e2c commit b9e9624

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

infrahub_sync/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ def apply_transform(cls, item: dict[str, Any], transform_expr: str, field: str)
140140
# Render the template using the item's context
141141
transformed_value = template.render(**item)
142142

143-
# Assign the result back to the item
144-
item[field] = transformed_value
143+
# Assign the result back to the item if not empty
144+
if transformed_value:
145+
item[field] = transformed_value
145146
except Exception as exc:
146147
raise ValueError(f"Failed to transform '{field}' with '{transform_expr}': {exc}") from exc
147148

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 = "infrahub-sync"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Infrahub-Sync is a versatile Python package that synchronizes data between a source and a destination system"
55
authors = ["OpsMill <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)