kailash 0.2.0__py3-none-any.whl → 0.2.2__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/api/custom_nodes_secure.py +2 -2
- kailash/api/studio_secure.py +1 -1
- kailash/mcp/client_new.py +1 -1
- kailash/mcp/server_new.py +6 -6
- kailash/nodes/ai/a2a.py +1 -1
- kailash/nodes/api/__init__.py +21 -0
- kailash/nodes/code/python.py +6 -0
- kailash/nodes/data/__init__.py +4 -2
- kailash/nodes/data/directory.py +278 -0
- kailash/nodes/data/sql.py +699 -256
- kailash/nodes/transform/processors.py +31 -0
- kailash/runtime/local.py +13 -0
- kailash/workflow/convergence.py +1 -1
- kailash/workflow/cycle_analyzer.py +346 -225
- kailash/workflow/cycle_builder.py +75 -69
- kailash/workflow/cycle_config.py +62 -46
- kailash/workflow/cycle_debugger.py +284 -184
- kailash/workflow/cycle_exceptions.py +111 -97
- kailash/workflow/cycle_profiler.py +272 -202
- kailash/workflow/graph.py +15 -0
- kailash/workflow/migration.py +238 -197
- kailash/workflow/templates.py +124 -105
- kailash/workflow/validation.py +356 -298
- kailash-0.2.2.dist-info/METADATA +121 -0
- {kailash-0.2.0.dist-info → kailash-0.2.2.dist-info}/RECORD +29 -28
- kailash-0.2.0.dist-info/METADATA +0 -1614
- {kailash-0.2.0.dist-info → kailash-0.2.2.dist-info}/WHEEL +0 -0
- {kailash-0.2.0.dist-info → kailash-0.2.2.dist-info}/entry_points.txt +0 -0
- {kailash-0.2.0.dist-info → kailash-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.2.0.dist-info → kailash-0.2.2.dist-info}/top_level.txt +0 -0
@@ -332,12 +332,35 @@ class DataTransformer(Node):
|
|
332
332
|
}, # Support for up to 5 additional arguments
|
333
333
|
}
|
334
334
|
|
335
|
+
def validate_inputs(self, **kwargs) -> Dict[str, Any]:
|
336
|
+
"""Override validate_inputs to accept arbitrary parameters for transformations.
|
337
|
+
|
338
|
+
DataTransformer needs to accept any input parameters that might be mapped
|
339
|
+
from other nodes, not just the predefined parameters in get_parameters().
|
340
|
+
This enables flexible data flow in workflows.
|
341
|
+
"""
|
342
|
+
# First, do the standard validation for defined parameters
|
343
|
+
validated = super().validate_inputs(**kwargs)
|
344
|
+
|
345
|
+
# Then, add any extra parameters that aren't in the schema
|
346
|
+
# These will be passed to the transformation context
|
347
|
+
defined_params = set(self.get_parameters().keys())
|
348
|
+
for key, value in kwargs.items():
|
349
|
+
if key not in defined_params:
|
350
|
+
validated[key] = value # Accept arbitrary additional parameters
|
351
|
+
|
352
|
+
return validated
|
353
|
+
|
335
354
|
def run(self, **kwargs) -> Dict[str, Any]:
|
336
355
|
# Extract the transformation functions
|
337
356
|
transformations = kwargs.get("transformations", [])
|
338
357
|
if not transformations:
|
339
358
|
return {"result": kwargs.get("data", [])}
|
340
359
|
|
360
|
+
# Debug: Check what kwargs we received
|
361
|
+
print(f"DATATRANSFORMER RUN DEBUG: kwargs keys = {list(kwargs.keys())}")
|
362
|
+
print(f"DATATRANSFORMER RUN DEBUG: kwargs = {kwargs}")
|
363
|
+
|
341
364
|
# Get all input data
|
342
365
|
input_data = {}
|
343
366
|
for key, value in kwargs.items():
|
@@ -371,6 +394,14 @@ class DataTransformer(Node):
|
|
371
394
|
local_vars = input_data.copy()
|
372
395
|
local_vars["result"] = result
|
373
396
|
|
397
|
+
# Debug: Print available variables
|
398
|
+
print(
|
399
|
+
f"DataTransformer DEBUG - Available variables: {list(local_vars.keys())}"
|
400
|
+
)
|
401
|
+
print(
|
402
|
+
f"DataTransformer DEBUG - Input data keys: {list(input_data.keys())}"
|
403
|
+
)
|
404
|
+
|
374
405
|
# Execute the code block
|
375
406
|
exec(transform_str, safe_globals, local_vars) # noqa: S102
|
376
407
|
|
kailash/runtime/local.py
CHANGED
@@ -399,8 +399,13 @@ class LocalRuntime:
|
|
399
399
|
source_node_id = edge[0]
|
400
400
|
mapping = edge[2].get("mapping", {})
|
401
401
|
|
402
|
+
print(f"LOCAL RUNTIME DEBUG: Processing edge {source_node_id} -> {node_id}")
|
403
|
+
print(f" Edge data: {edge[2]}")
|
404
|
+
print(f" Mapping: {mapping}")
|
405
|
+
|
402
406
|
if source_node_id in node_outputs:
|
403
407
|
source_outputs = node_outputs[source_node_id]
|
408
|
+
print(f" Source outputs: {list(source_outputs.keys())}")
|
404
409
|
|
405
410
|
# Check if the source node failed
|
406
411
|
if isinstance(source_outputs, dict) and source_outputs.get("failed"):
|
@@ -411,11 +416,19 @@ class LocalRuntime:
|
|
411
416
|
for source_key, target_key in mapping.items():
|
412
417
|
if source_key in source_outputs:
|
413
418
|
inputs[target_key] = source_outputs[source_key]
|
419
|
+
print(
|
420
|
+
f" MAPPED: {source_key} -> {target_key} (type: {type(source_outputs[source_key])})"
|
421
|
+
)
|
414
422
|
else:
|
423
|
+
print(
|
424
|
+
f" MISSING: {source_key} not in {list(source_outputs.keys())}"
|
425
|
+
)
|
415
426
|
self.logger.warning(
|
416
427
|
f"Source output '{source_key}' not found in node '{source_node_id}'. "
|
417
428
|
f"Available outputs: {list(source_outputs.keys())}"
|
418
429
|
)
|
430
|
+
else:
|
431
|
+
print(f" No outputs found for source node {source_node_id}")
|
419
432
|
|
420
433
|
# Apply parameter overrides
|
421
434
|
inputs.update(parameters)
|
kailash/workflow/convergence.py
CHANGED
@@ -229,7 +229,7 @@ class AdaptiveCondition(ConvergenceCondition):
|
|
229
229
|
|
230
230
|
|
231
231
|
def create_convergence_condition(
|
232
|
-
spec: Union[str, int, Callable, Dict]
|
232
|
+
spec: Union[str, int, Callable, Dict],
|
233
233
|
) -> ConvergenceCondition:
|
234
234
|
"""Factory function to create convergence conditions from various specs.
|
235
235
|
|