Repository: Avaiga/taipy
File: taipy/core/data/pickle.py (Python)

Code before:
# specific language governing permissions and limitations under the License.

import pickle
from datetime import datetime, timedelta
from typing import Any, List, Optional, Set

from taipy.common.config.common.scope import Scope

from .._entity._reload import _Reloader
from .._version._version_manager_factory import _VersionManagerFactory
from ._file_datanode_mixin import _FileDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit


class PickleDataNode(DataNode, _FileDataNodeMixin):
    """Data Node stored as a pickle file.

    The *properties* attribute can contain the following optional entries:

    - *default_path* (`str`): The default path of the Pickle file used at the instantiation of the
        data node.
    - *default_data*: The default data of the data node. It is used at the data node instantiation
        to write the data to the Pickle file.

    ???warning "To use with pickle-able data only"
        PickleDataNode should be used only for "pickle-able" data.

        Everything that's build up (recursively) from basic python types (dicts, lists, primitives,
        objects, object references, even circular) can usually be pickled by default.

        Things that are usually not pickle-able are, for example, sockets, file(handler)s, database
        connections, custom data structure using in-memory references to Python IDs, and so on.

        Please refer to the
        [pickle documentation](https://docs.python.org/3/library/pickle.html) for more information.

    """

    __STORAGE_TYPE = "pickle"

    _REQUIRED_PROPERTIES: List[str] = []

    def __init__(
        self,
        config_id: str,
        scope: Scope,
        id: Optional[DataNodeId] = None,
        owner_id: Optional[str] = None,
        parent_ids: Optional[Set[str]] = None,
        last_edit_date: Optional[datetime] = None,

Review comment (suggestion):
```suggestion
    ??? warning "To use with pickle-able data only"
```

Code after:
# specific language governing permissions and limitations under the License.

import pickle
from datetime import datetime, timedelta
from typing import Any, List, Optional, Set

from taipy.common.config.common.scope import Scope

from .._entity._reload import _Reloader
from .._version._version_manager_factory import _VersionManagerFactory
from ._file_datanode_mixin import _FileDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit


class PickleDataNode(DataNode, _FileDataNodeMixin):
    """Data Node stored as a pickle file.

    The *properties* attribute can contain the following optional entries:

    - *default_path* (`str`): The default path of the Pickle file used at the instantiation of the
        data node.
    - *default_data*: The default data of the data node. It is used at the data node instantiation
        to write the data to the Pickle file.

    ??? warning "To use with pickle-able data only"
        PickleDataNode should be used only for "pickle-able" data.

        Everything that's build up (recursively) from basic python types (dicts, lists,
        primitives, objects, object references, even circular) can usually be pickled by default.

        Things that are usually not pickle-able are, for example, sockets, file(handler)s,
        database connections, custom data structure using in-memory references to Python IDs,
        and so on.

        Please refer to the
        [pickle documentation](https://docs.python.org/3/library/pickle.html) for more information.

    """

    __STORAGE_TYPE = "pickle"

    _REQUIRED_PROPERTIES: List[str] = []

    def __init__(
        self,
        config_id: str,
        scope: Scope,
        id: Optional[DataNodeId] = None,
        owner_id: Optional[str] = None,
        parent_ids: Optional[Set[str]] = None,