Skip to content

Conversation

@pedroigorjs
Copy link
Contributor

@pedroigorjs pedroigorjs commented Dec 5, 2025

This pull request introduces enhancements to execution tracking and output normalization in the retrack engine. The main changes add support for node aliases, improve serialization of execution data, and introduce a utility for DataFrame normalization. These updates make execution outputs more readable and structured, and provide better context through node aliases.

Execution Tracking and Serialization Improvements:

  • Added an aliases attribute to the Execution class, along with methods to set and store node aliases during execution. This allows each node's output to be associated with a human-readable alias.
  • Implemented the to_normalized_dict method in Execution, which serializes inputs, outputs, child executions, and results into a normalized dictionary format for easier downstream processing and inspection.

Node Alias Support:

  • Added an alias() method to the BaseNode class, which returns a node's alias if available, falling back to its name. This ensures consistent alias retrieval for execution tracking.

Utility Functions:

  • Added the to_normalized_dict function in retrack/utils/transformers.py to convert DataFrame columns into a list of dictionaries with names and values, supporting the new serialization logic.

New Normalized JSON Example:

{
  "inputs": [
    {
      "name": "a",
      "values": [
        "1"
      ]
    },
    {
      "name": "b",
      "values": [
        "2"
      ]
    },
    {
      "name": "context",
      "values": [
        null
      ]
    },
    {
      "name": "c",
      "values": [
        "3"
      ]
    },
    {
      "name": "d",
      "values": [
        "4"
      ]
    }
  ],
  "outputs": [
    {
      "node_id": "c1ec8f0109c209bb",
      "alias": "Input",
      "values": [
        "1"
      ]
    },
    {
      "node_id": "fcc373ce66014558",
      "alias": "Input",
      "values": [
        "2"
      ]
    },
    {
      "node_id": "1b4b55ed6d5c9d46",
      "alias": "Math",
      "values": [
        3.0
      ]
    }
  ],
  "executions": [],
  "results": [
    {
      "name": "output",
      "values": [
        3.0
      ]
    },
    {
      "name": "message",
      "values": [
        null
      ]
    }
  ]
}

@pedroigorjs pedroigorjs self-assigned this Dec 5, 2025
@pedroigorjs pedroigorjs added the enhancement New feature or request label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants