Skip to content

Commit

Permalink
Do not unsuppress DeprecationWarnings with Kedro (#2747)
Browse files Browse the repository at this point in the history
* Do not unsuppress `DeprecationWarning`s with Kedro

Signed-off-by: Deepyaman Datta <[email protected]>

* Remove unused import

Signed-off-by: Deepyaman Datta <[email protected]>

---------

Signed-off-by: Deepyaman Datta <[email protected]>
  • Loading branch information
deepyaman authored Jun 30, 2023
1 parent 2f3811a commit 9c49a65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
23 changes: 9 additions & 14 deletions kedro/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"""
from __future__ import annotations

import warnings

from .cached_dataset import CachedDataset
from .cached_dataset import CachedDataset, CachedDataSet
from .core import (
AbstractDataSet,
AbstractVersionedDataSet,
Expand All @@ -15,17 +13,14 @@
Version,
)
from .data_catalog import DataCatalog
from .lambda_dataset import LambdaDataset
from .memory_dataset import MemoryDataset
from .partitioned_dataset import IncrementalDataset, PartitionedDataset

with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
from .cached_dataset import CachedDataSet
from .lambda_dataset import LambdaDataSet
from .memory_dataset import MemoryDataSet
from .partitioned_dataset import IncrementalDataSet, PartitionedDataSet

from .lambda_dataset import LambdaDataset, LambdaDataSet
from .memory_dataset import MemoryDataset, MemoryDataSet
from .partitioned_dataset import (
IncrementalDataset,
IncrementalDataSet,
PartitionedDataset,
PartitionedDataSet,
)

# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901
DataSetError: type[Exception]
Expand Down
2 changes: 0 additions & 2 deletions kedro/io/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

from kedro.utils import load_obj

warnings.simplefilter("default", DeprecationWarning)

VERSION_FORMAT = "%Y-%m-%dT%H.%M.%S.%fZ"
VERSIONED_FLAG_KEY = "versioned"
VERSION_KEY = "version"
Expand Down

0 comments on commit 9c49a65

Please sign in to comment.