Skip to content

Commit

Permalink
Annotate types for default load and save arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed Jul 10, 2019
1 parent 2a575d6 commit 5896daa
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions kedro/contrib/io/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
class DefaultArgumentsMixIn:
"""Mixin class that helps handle default load and save arguments."""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {}

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/csv_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class CSVLocalDataSet(AbstractVersionedDataSet):
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {"index": False}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"index": False}

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/csv_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class CSVS3DataSet(AbstractVersionedDataSet):
>>> assert data.equals(reloaded)
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {"index": False}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"index": False}

# pylint: disable=too-many-arguments
def __init__(
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/hdf_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class HDFLocalDataSet(AbstractVersionedDataSet):
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {}

# pylint: disable=too-many-arguments
def __init__(
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/hdf_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class HDFS3DataSet(AbstractVersionedDataSet):
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {}

# pylint: disable=too-many-arguments
def __init__(
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/json_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class JSONLocalDataSet(AbstractVersionedDataSet):
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {"indent": 4}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"indent": 4}

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/parquet_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class ParquetLocalDataSet(AbstractVersionedDataSet):
>>> assert data.equals(loaded_data)
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {"compression": None}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"compression": None}

# pylint: disable=too-many-arguments
def __init__(
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/pickle_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class PickleLocalDataSet(AbstractVersionedDataSet):
>>> reloaded = data_set.load()
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {}

BACKENDS = {"pickle": pickle, "joblib": joblib}

Expand Down
4 changes: 2 additions & 2 deletions kedro/io/pickle_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class PickleS3DataSet(AbstractVersionedDataSet):
>>> reloaded = data_set.load()
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {}

# pylint: disable=too-many-arguments
def __init__(
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ class SQLTableDataSet(AbstractDataSet):
"""

DEFAULT_LOAD_ARGS = {}
DEFAULT_SAVE_ARGS = {"index": False}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"index": False}

def _describe(self) -> Dict[str, Any]:
load_args = self._load_args.copy()
Expand Down
4 changes: 2 additions & 2 deletions kedro/io/text_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class TextLocalDataSet(AbstractVersionedDataSet):
>>> reloaded = data_set.load()
"""

DEFAULT_LOAD_ARGS = {"mode": "r"}
DEFAULT_SAVE_ARGS = {"mode": "w"}
DEFAULT_LOAD_ARGS: Dict[str, Any] = {"mode": "r"}
DEFAULT_SAVE_ARGS: Dict[str, Any] = {"mode": "w"}

def __init__(
self,
Expand Down

0 comments on commit 5896daa

Please sign in to comment.