Skip to content

taipy.core.DataNode

Bases: _Entity

Reference to a dataset.

A Data Node is an abstract class that holds metadata related to the dataset it refers to. In particular, a data node holds the name, the scope, the parent identifier, the last edit date, and some additional properties of the data.
A Data Node also contains information and methods needed to access the dataset. This information depends on the type of storage, and it is held by subclasses (such as SQL Data Node, CSV Data Node, ...).

Note

It is recommended not to instantiate subclasses of DataNode directly.

Attributes:

Name Type Description
config_id str

Identifier of the data node configuration. It must be a valid Python identifier.

scope Scope

The scope of this data node.

id str

The unique identifier of this data node.

name str

A user-readable name of this data node.

parent_id str

The identifier of the parent (pipeline_id, scenario_id, cycle_id) or None.

last_edit_date datetime

The date and time of the last modification.

job_ids List[str]

The ordered list of jobs that have written this data node.

cacheable bool

True if this data node is cacheable. False otherwise.

validity_period Optional[timedelta]

The validity period of a cacheable data node. Implemented as a timedelta. If validity_period is set to None, the data_node is always up-to-date.

edit_in_progress bool

True if a task computing the data node has been submitted and not completed yet. False otherwise.

kwargs bool

A dictionary of additional properties.

edition_in_progress property writable

Deprecated. Use edit_in_progress instead.

is_ready_for_reading: bool property

Indicate if this data node is ready for reading.

Returns:

Name Type Description
bool bool

False if the data is locked for modification or if the data has never been written. True otherwise.

last_edition_date property writable

Deprecated. Use last_edit_date instead.

filter(operators, join_operator=JoinOperator.AND)

Read the data referenced by the data node, appying a filter.

The data is filtered by the provided list of 3-tuples (key, value, Operator).

If multiple filter operators are provided, filtered data will be joined based on the join operator (AND or OR).

Parameters:

Name Type Description Default
operators Union[List[Tuple], Tuple]

TODO

required
join_operator JoinOperator

The operator used to join the multiple filter 3-tuples.

JoinOperator.AND

lock_edit()

Lock the edit of this data node.

Note

The data node can be unlocked with the method unlock_edit().

lock_edition()

Deprecated. Use lock_edit instead.

read()

Read the data referenced by this data node.

Returns:

Name Type Description
Any Any

The data referenced by this data node. None if the data has not been written yet.

read_or_raise()

Read the data referenced by this data node.

Returns:

Name Type Description
Any Any

The data referenced by this data node.

Raises:

Type Description
NoData

If the data has not been written yet.

unlock_edit(at=None, job_id=None)

Unlocks the edit of the data node.

Parameters:

Name Type Description Default
at datetime

Deprecated.

None
job_id JobId

Deprecated.

None
Note

The data node can be locked with the method lock_edit().

unlock_edition(at=None, job_id=None)

Deprecated. Use (DataNode.)unlock_edit()^` instead.

write(data, job_id=None)

Write some data to this data node.

Parameters:

Name Type Description Default
data Any

The data to write to this data node.

required
job_id JobId

An optional identifier of the writer.

None