kailash 0.9.7__py3-none-any.whl → 0.9.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kailash/__init__.py +1 -1
- kailash/nodes/base.py +58 -5
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/METADATA +1 -1
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/RECORD +8 -8
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/WHEEL +0 -0
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/entry_points.txt +0 -0
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.9.7.dist-info → kailash-0.9.8.dist-info}/top_level.txt +0 -0
kailash/__init__.py
CHANGED
kailash/nodes/base.py
CHANGED
@@ -216,17 +216,58 @@ class Node(ABC):
|
|
216
216
|
)
|
217
217
|
self.logger = logging.getLogger(f"kailash.nodes.{self.id}")
|
218
218
|
|
219
|
-
# Filter out internal fields from config
|
220
|
-
|
219
|
+
# Filter out internal fields from config with comprehensive parameter handling
|
220
|
+
# Get parameter definitions once and cache for both filtering and validation
|
221
|
+
try:
|
222
|
+
if not hasattr(self, "_temp_param_definitions"):
|
223
|
+
self._temp_param_definitions = self.get_parameters()
|
224
|
+
defined_params = set(self._temp_param_definitions.keys())
|
225
|
+
except Exception as e:
|
226
|
+
# If get_parameters() fails, log but continue with safe defaults
|
227
|
+
self.logger.debug(
|
228
|
+
f"Could not get parameter definitions during init: {e}"
|
229
|
+
)
|
230
|
+
defined_params = set()
|
231
|
+
self._temp_param_definitions = {}
|
232
|
+
|
233
|
+
# Comprehensive parameter filtering: handle ALL potential conflicts
|
234
|
+
# Fields that are always internal (never user parameters)
|
235
|
+
always_internal = {"metadata"}
|
236
|
+
|
237
|
+
# Fields that can be either internal or user parameters
|
238
|
+
potentially_user_params = {
|
221
239
|
"id",
|
222
240
|
"name",
|
223
241
|
"description",
|
224
242
|
"version",
|
225
243
|
"author",
|
226
244
|
"tags",
|
227
|
-
"metadata",
|
228
245
|
}
|
229
|
-
|
246
|
+
|
247
|
+
# Build dynamic filter list based on user-defined parameters
|
248
|
+
internal_fields = always_internal.copy()
|
249
|
+
for field in potentially_user_params:
|
250
|
+
if field not in defined_params:
|
251
|
+
# Field is not user-defined, so treat as internal field
|
252
|
+
internal_fields.add(field)
|
253
|
+
# If field IS user-defined, don't add to internal_fields (preserve it)
|
254
|
+
|
255
|
+
# Also filter any field that starts with metadata prefix or other internal patterns
|
256
|
+
# This handles cases like 'metadata_name', 'metadata_*', etc.
|
257
|
+
def is_internal_field(field_name: str) -> bool:
|
258
|
+
# Check if it's in our explicit internal fields list
|
259
|
+
if field_name in internal_fields:
|
260
|
+
return True
|
261
|
+
# Check for metadata-related field patterns
|
262
|
+
if field_name.startswith("metadata_"):
|
263
|
+
return True
|
264
|
+
# Check for other internal patterns
|
265
|
+
if field_name.startswith("_"): # Private fields
|
266
|
+
return True
|
267
|
+
return False
|
268
|
+
|
269
|
+
# Apply comprehensive filtering
|
270
|
+
self.config = {k: v for k, v in kwargs.items() if not is_internal_field(k)}
|
230
271
|
|
231
272
|
# Parameter resolution cache - initialize before validation
|
232
273
|
cache_size = int(
|
@@ -554,11 +595,23 @@ class Node(ABC):
|
|
554
595
|
return bool(re.match(r"^\$\{[^}]+\}$", value))
|
555
596
|
|
556
597
|
def _get_cached_parameters(self) -> dict[str, NodeParameter]:
|
557
|
-
"""Get cached parameter definitions.
|
598
|
+
"""Get cached parameter definitions with optimal performance.
|
599
|
+
|
600
|
+
Uses parameters cached during initialization to avoid duplicate get_parameters() calls.
|
558
601
|
|
559
602
|
Returns:
|
560
603
|
Dictionary of parameter definitions, cached for performance
|
561
604
|
"""
|
605
|
+
# First check if we have parameters cached from initialization
|
606
|
+
if hasattr(self, "_temp_param_definitions") and self._temp_param_definitions:
|
607
|
+
# Use cached parameters from init and clean up temporary cache
|
608
|
+
if self._cached_params is None:
|
609
|
+
self._cached_params = self._temp_param_definitions
|
610
|
+
# Clean up temporary cache to free memory
|
611
|
+
delattr(self, "_temp_param_definitions")
|
612
|
+
return self._cached_params
|
613
|
+
|
614
|
+
# Fallback to original behavior if no cached parameters from init
|
562
615
|
if self._cached_params is None:
|
563
616
|
try:
|
564
617
|
self._cached_params = self.get_parameters()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
kailash/__init__.py,sha256=
|
1
|
+
kailash/__init__.py,sha256=X2FdWjwIF5LEYMDpF8b6b_KmtkP63DBf3-RNmu7ytnw,2771
|
2
2
|
kailash/__main__.py,sha256=vr7TVE5o16V6LsTmRFKG6RDKUXHpIWYdZ6Dok2HkHnI,198
|
3
3
|
kailash/access_control.py,sha256=MjKtkoQ2sg1Mgfe7ovGxVwhAbpJKvaepPWr8dxOueMA,26058
|
4
4
|
kailash/access_control_abac.py,sha256=FPfa_8PuDP3AxTjdWfiH3ntwWO8NodA0py9W8SE5dno,30263
|
@@ -140,7 +140,7 @@ kailash/monitoring/__init__.py,sha256=C5WmkNpk_mmAScqMWiCfkUbjhM5W16dsnRnc3Ial-U
|
|
140
140
|
kailash/monitoring/alerts.py,sha256=eKX4ooPw1EicumPuswlR_nU18UgRETWvFg8FzCW5pVU,21416
|
141
141
|
kailash/monitoring/metrics.py,sha256=SiAnL3o6K0QaJHgfAuWBa-0pTkW5zymhuPEsj4bgOgM,22022
|
142
142
|
kailash/nodes/__init__.py,sha256=p2KSo0dyUBCLClU123qpQ0tyv5S_36PTxosNyW58nyY,1031
|
143
|
-
kailash/nodes/base.py,sha256=
|
143
|
+
kailash/nodes/base.py,sha256=GR2E1fWf8j1yMvJic7m2NAih7kjY1NtoDi47hHwoZ40,85437
|
144
144
|
kailash/nodes/base_async.py,sha256=whxepCiVplrltfzEQuabmnGCpEV5WgfqwgxbLdCyiDk,8864
|
145
145
|
kailash/nodes/base_cycle_aware.py,sha256=Xpze9xZzLepWeLpi9Y3tMn1dm2LVv-omr5TSQuGTtWo,13377
|
146
146
|
kailash/nodes/base_with_acl.py,sha256=ZfrkLPgrEBcNbG0LKvtq6glDxyOYOMRw3VXX4vWX6bI,11852
|
@@ -403,9 +403,9 @@ kailash/workflow/templates.py,sha256=XQMAKZXC2dlxgMMQhSEOWAF3hIbe9JJt9j_THchhAm8
|
|
403
403
|
kailash/workflow/type_inference.py,sha256=i1F7Yd_Z3elTXrthsLpqGbOnQBIVVVEjhRpI0HrIjd0,24492
|
404
404
|
kailash/workflow/validation.py,sha256=r2zApGiiG8UEn7p5Ji842l8OR1_KftzDkWc7gg0cac0,44675
|
405
405
|
kailash/workflow/visualization.py,sha256=nHBW-Ai8QBMZtn2Nf3EE1_aiMGi9S6Ui_BfpA5KbJPU,23187
|
406
|
-
kailash-0.9.
|
407
|
-
kailash-0.9.
|
408
|
-
kailash-0.9.
|
409
|
-
kailash-0.9.
|
410
|
-
kailash-0.9.
|
411
|
-
kailash-0.9.
|
406
|
+
kailash-0.9.8.dist-info/licenses/LICENSE,sha256=Axe6g7bTrJkToK9h9j2SpRUKKNaDZDCo2lQ2zPxCE6s,1065
|
407
|
+
kailash-0.9.8.dist-info/METADATA,sha256=u5ctxqIA1Wv7Vkj-25IgjKvU33wmvjImTjYku2hyFaY,22298
|
408
|
+
kailash-0.9.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
409
|
+
kailash-0.9.8.dist-info/entry_points.txt,sha256=M_q3b8PG5W4XbhSgESzIJjh3_4OBKtZFYFsOdkr2vO4,45
|
410
|
+
kailash-0.9.8.dist-info/top_level.txt,sha256=z7GzH2mxl66498pVf5HKwo5wwfPtt9Aq95uZUpH6JV0,8
|
411
|
+
kailash-0.9.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|