kailash 0.8.2__py3-none-any.whl → 0.8.3__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 CHANGED
@@ -52,7 +52,7 @@ except ImportError:
52
52
  # For backward compatibility
53
53
  WorkflowGraph = Workflow
54
54
 
55
- __version__ = "0.8.2"
55
+ __version__ = "0.8.3"
56
56
 
57
57
  __all__ = [
58
58
  # Core workflow components
@@ -8,7 +8,13 @@ import uuid
8
8
  from datetime import datetime, timezone
9
9
  from typing import Any, Dict, List, Optional
10
10
 
11
- from sqlalchemy import JSON, Boolean, CheckConstraint, Column, DateTime
11
+ from sqlalchemy import (
12
+ JSON,
13
+ Boolean,
14
+ CheckConstraint,
15
+ Column,
16
+ DateTime,
17
+ )
12
18
  from sqlalchemy import Enum as SQLEnum
13
19
  from sqlalchemy import (
14
20
  Float,
@@ -103,6 +103,7 @@ ALLOWED_MODULES = {
103
103
  "glob", # For file pattern matching
104
104
  "xml", # For XML processing
105
105
  "uuid", # For generating unique identifiers (safe, no I/O)
106
+ "hashlib", # For cryptographic hashing (safe for common use cases)
106
107
  }
107
108
 
108
109
 
@@ -380,18 +380,89 @@ class WorkflowBuilder:
380
380
  WorkflowValidationError: If nodes don't exist
381
381
  ConnectionError: If connection is invalid
382
382
  """
383
+ # Enhanced error messages with helpful suggestions
383
384
  if from_node not in self.nodes:
384
- raise WorkflowValidationError(
385
- f"Source node '{from_node}' not found in workflow"
386
- )
385
+ available_nodes = list(self.nodes.keys())
386
+ similar_nodes = [
387
+ n
388
+ for n in available_nodes
389
+ if from_node.lower() in n.lower() or n.lower() in from_node.lower()
390
+ ]
391
+
392
+ error_msg = f"Source node '{from_node}' not found in workflow."
393
+ if available_nodes:
394
+ error_msg += f"\nAvailable nodes: {available_nodes}"
395
+ if similar_nodes:
396
+ error_msg += f"\nDid you mean: {similar_nodes}?"
397
+ error_msg += f"\n\nTip: Use workflow.add_node() to create nodes before connecting them."
398
+ error_msg += f"\nExample: workflow.add_node('CSVReaderNode', '{from_node}', {{'file_path': 'data.csv'}})"
399
+
400
+ raise WorkflowValidationError(error_msg)
401
+
387
402
  if to_node not in self.nodes:
388
- raise WorkflowValidationError(
389
- f"Target node '{to_node}' not found in workflow"
403
+ available_nodes = list(self.nodes.keys())
404
+ similar_nodes = [
405
+ n
406
+ for n in available_nodes
407
+ if to_node.lower() in n.lower() or n.lower() in to_node.lower()
408
+ ]
409
+
410
+ error_msg = f"Target node '{to_node}' not found in workflow."
411
+ if available_nodes:
412
+ error_msg += f"\nAvailable nodes: {available_nodes}"
413
+ if similar_nodes:
414
+ error_msg += f"\nDid you mean: {similar_nodes}?"
415
+ error_msg += f"\n\nTip: Use workflow.add_node() to create nodes before connecting them."
416
+ error_msg += f"\nExample: workflow.add_node('PythonCodeNode', '{to_node}', {{'code': 'result = data'}})"
417
+
418
+ raise WorkflowValidationError(error_msg)
419
+
420
+ # Self-connection check with helpful message
421
+ if from_node == to_node:
422
+ raise ConnectionError(
423
+ f"Cannot connect node '{from_node}' to itself.\n"
424
+ f"Tip: Consider using intermediate nodes or different port names.\n"
425
+ f"Example: Create a separate processing node between input and output."
390
426
  )
391
427
 
392
- # Self-connection check
393
- if from_node == to_node:
394
- raise ConnectionError(f"Cannot connect node '{from_node}' to itself")
428
+ # REFINED: Enhanced duplicate connection detection
429
+ for existing_conn in self.connections:
430
+ if (
431
+ existing_conn["from_node"] == from_node
432
+ and existing_conn["from_output"] == from_output
433
+ and existing_conn["to_node"] == to_node
434
+ and existing_conn["to_input"] == to_input
435
+ ):
436
+ raise ConnectionError(
437
+ f"Duplicate connection detected: {from_node}.{from_output} -> {to_node}.{to_input}\n"
438
+ f"This connection already exists in the workflow.\n"
439
+ f"Tip: Remove the duplicate add_connection() call or use different port names.\n"
440
+ f"Current connections: {len(self.connections)} total"
441
+ )
442
+
443
+ # Enhanced port validation with suggestions
444
+ common_output_ports = [
445
+ "data",
446
+ "result",
447
+ "output",
448
+ "response",
449
+ "content",
450
+ "value",
451
+ ]
452
+ common_input_ports = ["data", "input", "input_data", "content", "value"]
453
+
454
+ # Log port usage patterns for debugging
455
+ if from_output not in common_output_ports:
456
+ logger.debug(
457
+ f"Using non-standard output port '{from_output}' on node '{from_node}'"
458
+ )
459
+ logger.debug(f"Common output ports: {common_output_ports}")
460
+
461
+ if to_input not in common_input_ports:
462
+ logger.debug(
463
+ f"Using non-standard input port '{to_input}' on node '{to_node}'"
464
+ )
465
+ logger.debug(f"Common input ports: {common_input_ports}")
395
466
 
396
467
  # Add connection to list
397
468
  connection = {
@@ -402,7 +473,15 @@ class WorkflowBuilder:
402
473
  }
403
474
  self.connections.append(connection)
404
475
 
405
- logger.info(f"Connected '{from_node}.{from_output}' to '{to_node}.{to_input}'")
476
+ logger.info(f"Connected '{from_node}.{from_output}' -> '{to_node}.{to_input}'")
477
+
478
+ # Provide helpful tips for common connection patterns
479
+ if from_output == to_input == "data":
480
+ logger.debug(f"Using standard data flow connection pattern")
481
+ elif from_output in ["result", "output"] and to_input in ["data", "input"]:
482
+ logger.debug(f"Using result-to-input connection pattern")
483
+ else:
484
+ logger.debug(f"Using custom port mapping: {from_output} -> {to_input}")
406
485
  return self
407
486
 
408
487
  def connect(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kailash
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: Python SDK for the Kailash container-node architecture
5
5
  Home-page: https://github.com/integrum/kailash-python-sdk
6
6
  Author: Integrum
@@ -1,4 +1,4 @@
1
- kailash/__init__.py,sha256=c6u1PTFEDN9LCF5E1aAVq_2MWi1wkrAywWwrfejFdis,2878
1
+ kailash/__init__.py,sha256=YyZQsrDNnTGLOgebSi3bdZzjuDDTWs_s1v0XjVHwz5w,2878
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
@@ -92,7 +92,7 @@ kailash/middleware/core/schema.py,sha256=uVF-5ZJlLYHOQdsKrG46FnTO1bq_QtDjhUSkIID
92
92
  kailash/middleware/core/workflows.py,sha256=kjwwP69-T6eCY7kWIMLUBwVy2CapoPR34cqCETquq0s,12480
93
93
  kailash/middleware/database/__init__.py,sha256=UMws94L-vja94AjfzPWIgn0h4_5BGQzI3YaSdqtzeLk,1682
94
94
  kailash/middleware/database/base.py,sha256=cWEei9Gb6J-C-bpa4M4T0takfWE3POXWumzYhqX3V4g,2735
95
- kailash/middleware/database/base_models.py,sha256=t4HfXKGHZkfLkzoRgXXvlO_wdgsqXhm7S0XP4OIdQXc,18262
95
+ kailash/middleware/database/base_models.py,sha256=XBcHEUmcpl2f6zZHCAgHQ_0jqUB3Gl82XARR83lW5GY,18287
96
96
  kailash/middleware/database/enums.py,sha256=Yo_wMS7OpsleWtNMESTc2LTf15d93nPnBADIn2EHjeQ,2516
97
97
  kailash/middleware/database/migrations.py,sha256=v5VZxsqciwmOl3rzIBQLp5p6-OP8OG_EL3mu65_yrCM,240
98
98
  kailash/middleware/database/models.py,sha256=CJwwUEdgxqBteXqpFJr1tWskjypJxViZXjODZlByrFk,17784
@@ -166,7 +166,7 @@ kailash/nodes/cache/cache_invalidation.py,sha256=IUvxrRj3K5EF29Z2EaKl7t6Uze_cssn
166
166
  kailash/nodes/cache/redis_pool_manager.py,sha256=GR82GCWxo_gAzRE-091OB6AhKre8CTwM3OoePLb2gvE,21574
167
167
  kailash/nodes/code/__init__.py,sha256=yhEwuMjUEPFfe6hMGMd4E4gZdLUuf2JEQ7knYapiM4o,1283
168
168
  kailash/nodes/code/async_python.py,sha256=Ai-iMpmz-sAori73JBk0wZtqmwtmF2GNPDxqB04I2Ck,37058
169
- kailash/nodes/code/python.py,sha256=AfKNL4B-OTiFQoNuCzZ2mLiJV61TaHLXhHmXudl20eg,60592
169
+ kailash/nodes/code/python.py,sha256=no3JoQMXz45nKraa81YAI4S-DM-dnVHu8NS-xVq-Ipw,60664
170
170
  kailash/nodes/compliance/__init__.py,sha256=6a_FL4ofc8MAVuZ-ARW5uYenZLS4mBFVM9AI2QsnoF8,214
171
171
  kailash/nodes/compliance/data_retention.py,sha256=90bH_eGwlcDzUdklAJeXQM-RcuLUGQFQ5fgHOK8a4qk,69443
172
172
  kailash/nodes/compliance/gdpr.py,sha256=ZMoHZjAo4QtGwtFCzGMrAUBFV3TbZOnJ5DZGZS87Bas,70548
@@ -317,7 +317,7 @@ kailash/visualization/reports.py,sha256=D7kJ0flHr16d-qSEq8vnw20N8u_dgTrXtKVSXVm8
317
317
  kailash/workflow/__init__.py,sha256=DDQDE9K6RmbX6479guNLLgjiVVV-gQERRvCEJWSVlsM,1836
318
318
  kailash/workflow/async_builder.py,sha256=iv8bDJHdWAUZ77SyMo6sucd92dTdtXesdxycrSE7mM4,20613
319
319
  kailash/workflow/async_patterns.py,sha256=X0ZDXwr6UAu0WC1xnCB7-0V1-tRbKs9UI4JqaBCB6tE,22824
320
- kailash/workflow/builder.py,sha256=3l5wVRtMB1Om_QmeoQ6jsrc_Lm8Hna_pH47UjnfMb9I,31184
320
+ kailash/workflow/builder.py,sha256=Ux0TiXfnwRKVhmMEDBv8bE6cDoXSjs6-3fAH9BABBQE,34859
321
321
  kailash/workflow/convergence.py,sha256=vfIDR-uNaQE-LVUEzrRtfgKPgX9gL0nLNH-nTg5ra-c,10031
322
322
  kailash/workflow/cycle_analyzer.py,sha256=BGBpgdB-g0-KRI65sVAvHV4lxfoCzMt4uKOHbw8GXT4,32596
323
323
  kailash/workflow/cycle_builder.py,sha256=uWAx8K4ZKMtFC3mWylK4gHT03xeu0xChJlhw50hVqEE,20883
@@ -339,9 +339,9 @@ kailash/workflow/state.py,sha256=UTZxs5-Ona6uvBhx1__i6-RX8gB4qazkBIWE7uyRmWQ,760
339
339
  kailash/workflow/templates.py,sha256=98EN5H4fO9b4xeczk20Hu5L8hNcAuRQNGayT6vnZYCw,48540
340
340
  kailash/workflow/validation.py,sha256=rWZNJYA_XAfk_og6Cxz8p1gZ3j5CylPvMTDXg2SfjgM,38574
341
341
  kailash/workflow/visualization.py,sha256=nHBW-Ai8QBMZtn2Nf3EE1_aiMGi9S6Ui_BfpA5KbJPU,23187
342
- kailash-0.8.2.dist-info/licenses/LICENSE,sha256=Axe6g7bTrJkToK9h9j2SpRUKKNaDZDCo2lQ2zPxCE6s,1065
343
- kailash-0.8.2.dist-info/METADATA,sha256=W8EHXCHAgc_L7yUSvGR-DlzjB3UL14XxxrubBpkd8d8,20263
344
- kailash-0.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
345
- kailash-0.8.2.dist-info/entry_points.txt,sha256=M_q3b8PG5W4XbhSgESzIJjh3_4OBKtZFYFsOdkr2vO4,45
346
- kailash-0.8.2.dist-info/top_level.txt,sha256=z7GzH2mxl66498pVf5HKwo5wwfPtt9Aq95uZUpH6JV0,8
347
- kailash-0.8.2.dist-info/RECORD,,
342
+ kailash-0.8.3.dist-info/licenses/LICENSE,sha256=Axe6g7bTrJkToK9h9j2SpRUKKNaDZDCo2lQ2zPxCE6s,1065
343
+ kailash-0.8.3.dist-info/METADATA,sha256=ke3WhdN0tyrq6YneptdCJH7I7SBOu7djfwWhzVDrAqw,20263
344
+ kailash-0.8.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
345
+ kailash-0.8.3.dist-info/entry_points.txt,sha256=M_q3b8PG5W4XbhSgESzIJjh3_4OBKtZFYFsOdkr2vO4,45
346
+ kailash-0.8.3.dist-info/top_level.txt,sha256=z7GzH2mxl66498pVf5HKwo5wwfPtt9Aq95uZUpH6JV0,8
347
+ kailash-0.8.3.dist-info/RECORD,,