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

Code before:
from ..exceptions.exceptions import UnknownCompressionAlgorithm, UnknownParquetEngine
from ..job.job_id import JobId
from ._file_datanode_mixin import _FileDataNodeMixin
from ._tabular_datanode_mixin import _TabularDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit


class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
    """Data Node stored as a Parquet file.

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

    - *default_path* (`str`): The default path of the Parquet file used at the instantiation of
        the data node.
    - *default_data* (`Any`): The default data of the data node. It is used at the data node
        instantiation to write the data to the Parquet file.
    - *has_header* (`bool`): If True, indicates that the Parquet file has a header.
    - *exposed_type* (`str`): The exposed type of the data read from Parquet
        file.<br/> The default value is `pandas`.
    - *engine* (`Optional[str]`): Parquet library to use. Possible values are
        *"fastparquet"* or *"pyarrow"*.<br/> The default value is *"pyarrow"*.
    - *compression* (`Optional[str]`): Name of the compression to use. Possible values
        are *"snappy"*, *"gzip"*, *"brotli"*, or *"none"* (no compression).<br/>
        The default value is *"snappy"*.
    - *read_kwargs* (`Optional[dict]`): Additional arguments passed to the
        *pandas.read_parquet()* function when reading the data.<br/>
        The arguments in *"read_kwargs"* have a **higher precedence** than the top-level
        arguments which are also passed to Pandas.
    - *write_kwargs* (`Optional[dict]`): Additional Arguments passed to the
        *pandas.DataFrame.write_parquet()* function when writing the data. <br/>
        The arguments in *"write_kwargs"* have a **higher precedence** than the
        top-level arguments which are also passed to Pandas.
    """

    __STORAGE_TYPE = "parquet"
    __ENGINE_PROPERTY = "engine"
    __VALID_PARQUET_ENGINES = ["pyarrow", "fastparquet"]
    __COMPRESSION_PROPERTY = "compression"
    __VALID_COMPRESSION_ALGORITHMS = ["snappy", "gzip", "brotli", "none"]
    __READ_KWARGS_PROPERTY = "read_kwargs"
    __WRITE_KWARGS_PROPERTY = "write_kwargs"
    _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,

Review comment (suggestion):
```suggestion
    - *read_kwargs* (`Optional[dict]`): Additional parameters passed to the
```

Code after:
from ..exceptions.exceptions import UnknownCompressionAlgorithm, UnknownParquetEngine
from ..job.job_id import JobId
from ._file_datanode_mixin import _FileDataNodeMixin
from ._tabular_datanode_mixin import _TabularDataNodeMixin
from .data_node import DataNode
from .data_node_id import DataNodeId, Edit


class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin):
    """Data Node stored as a Parquet file.

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

    - *default_path* (`str`): The default path of the Parquet file used at the instantiation of
        the data node.
    - *default_data* (`Any`): The default data of the data node. It is used at the data node
        instantiation to write the data to the Parquet file.
    - *has_header* (`bool`): If True, indicates that the Parquet file has a header.
    - *exposed_type* (`str`): The exposed type of the data read from Parquet
        file.<br/> The default value is `pandas`.
    - *engine* (`Optional[str]`): Parquet library to use. Possible values are
        *"fastparquet"* or *"pyarrow"*.<br/> The default value is *"pyarrow"*.
    - *compression* (`Optional[str]`): Name of the compression to use. Possible values
        are *"snappy"*, *"gzip"*, *"brotli"*, or *"none"* (no compression).<br/>
        The default value is *"snappy"*.
    - *read_kwargs* (`Optional[dict]`): Additional parameters passed to the
        *pandas.read_parquet()* function when reading the data.<br/>
        The parameters in *"read_kwargs"* have a **higher precedence** than the top-level
        parameters which are also passed to Pandas.
    - *write_kwargs* (`Optional[dict]`): Additional parameters passed to the
        *pandas.DataFrame.write_parquet()* function when writing the data. <br/>
        The parameters in *"write_kwargs"* have a **higher precedence** than the
        top-level parameters which are also passed to Pandas.
    """

    __STORAGE_TYPE = "parquet"
    __ENGINE_PROPERTY = "engine"
    __VALID_PARQUET_ENGINES = ["pyarrow", "fastparquet"]
    __COMPRESSION_PROPERTY = "compression"
    __VALID_COMPRESSION_ALGORITHMS = ["snappy", "gzip", "brotli", "none"]
    __READ_KWARGS_PROPERTY = "read_kwargs"
    __WRITE_KWARGS_PROPERTY = "write_kwargs"
    _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,