create_script

create_script(**kwargs)

Transforms a directed acyclic graph (DAG) into code.

See also: AWS API Documentation

Request Syntax

response = client.create_script(
    DagNodes=[
        {
            'Id': 'string',
            'NodeType': 'string',
            'Args': [
                {
                    'Name': 'string',
                    'Value': 'string',
                    'Param': True|False
                },
            ],
            'LineNumber': 123
        },
    ],
    DagEdges=[
        {
            'Source': 'string',
            'Target': 'string',
            'TargetParameter': 'string'
        },
    ],
    Language='PYTHON'|'SCALA'
)
Parameters
  • DagNodes (list) --

    A list of the nodes in the DAG.

    • (dict) --

      Represents a node in a directed acyclic graph (DAG)

      • Id (string) -- [REQUIRED]

        A node identifier that is unique within the node's graph.

      • NodeType (string) -- [REQUIRED]

        The type of node that this is.

      • Args (list) -- [REQUIRED]

        Properties of the node, in the form of name-value pairs.

        • (dict) --

          An argument or property of a node.

          • Name (string) -- [REQUIRED]

            The name of the argument or property.

          • Value (string) -- [REQUIRED]

            The value of the argument or property.

          • Param (boolean) --

            True if the value is used as a parameter.

      • LineNumber (integer) --

        The line number of the node.

  • DagEdges (list) --

    A list of the edges in the DAG.

    • (dict) --

      Represents a directional edge in a directed acyclic graph (DAG).

      • Source (string) -- [REQUIRED]

        The ID of the node at which the edge starts.

      • Target (string) -- [REQUIRED]

        The ID of the node at which the edge ends.

      • TargetParameter (string) --

        The target of the edge.

  • Language (string) -- The programming language of the resulting code from the DAG.
Return type

dict

Returns

Response Syntax

{
    'PythonScript': 'string',
    'ScalaCode': 'string'
}

Response Structure

  • (dict) --

    • PythonScript (string) --

      The Python script generated from the DAG.

    • ScalaCode (string) --

      The Scala code generated from the DAG.

Exceptions

  • Glue.Client.exceptions.InvalidInputException
  • Glue.Client.exceptions.InternalServiceException
  • Glue.Client.exceptions.OperationTimeoutException