nv_dfm_core.api.Statement#

class nv_dfm_core.api.Statement(*, dfm_node_id=<factory>, dfm_after=None)[source]#

A Statement is the base class for all syntactic constructs that can appear in a Pipeline body. A Statement does not have a node_id, therefore it cannot be referenced by other nodes (it’s a syntactic construct without a value)

Parameters:
get_noderef_and_placeparam_pydantic_fields()[source]#

Returns all pydantic fields that have a NodeRef or PlaceParam value. Those are fields that get their values from references and not from literals.

Return type:

list[tuple[str, NodeRef | PlaceParam]]

model_config: ConfigDict = {'extra': 'forbid', 'frozen': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(_Statement__context)[source]#

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_Statement__context (Any)

classmethod rewrite_statement_object_to_noderef(v, ctx)[source]#

Replace a Statement object reference with its corresponding node id, which is what’s actually stored in the object. Note that technically only Expressions have values. Our Pydantic models use NodeRef as the type, which enforces fields to be Expressions on the Pydantic level. But we rewrite all Statement fields here, because like the after field above, we may want the user to pass/reference nodes that are not Expressions.

Parameters:
  • v (Any)

  • ctx (Any)

Return type:

Any