Skip to content

Commit

Permalink
Fixed indentation
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Khaustova <ymax70rus@gmail.com>
  • Loading branch information
ElenaKhaustova committed Nov 27, 2024
1 parent 8f0fe4f commit 0db9b46
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions kedro/io/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,27 +231,21 @@ def from_config(

def to_config(self) -> dict[str, Any]:
"""Converts the dataset instance into a dictionary-based configuration for
serialization.
Ensures that any subclass-specific details are handled, with
serialization. Ensures that any subclass-specific details are handled, with
additional logic for versioning and caching implemented for `CachedDataset`.
Functionality:
1. Base Configuration:
- Adds a key for the dataset's type using its module and class name.
- Includes the initialization arguments (`_init_args`) if available.
Adds a key for the dataset's type using its module and class name and
includes the initialization arguments.
2. Special Handling for `CachedDataset`:
- Extracts the underlying dataset's configuration.
- Handles the `versioned` flag and removes unnecessary metadata.
- Ensures the embedded dataset's configuration is appropriately flattened
or transformed.
For `CachedDataset` it extracts the underlying dataset's configuration,
handles the `versioned` flag and removes unnecessary metadata. It also
ensures the embedded dataset's configuration is appropriately flattened
or transformed.
3. Versioning:
- If the dataset has a version key, sets the `versioned` flag in the configuration.
If the dataset has a version key, it sets the `versioned` flag in the
configuration.
4. Metadata Removal:
- Removes the `metadata` key from the configuration if present.
Removes the `metadata` key from the configuration if present.
Returns:
A dictionary containing the dataset's type and initialization arguments.
Expand Down

0 comments on commit 0db9b46

Please sign in to comment.