Skip to content

Commit

Permalink
use open_file
Browse files Browse the repository at this point in the history
  • Loading branch information
altescy committed Feb 24, 2021
1 parent c31bbce commit 244f8e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pdpcli/commands/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _is_pickle_file(file_path: Union[str, Path]) -> bool:
def _load_pipeline_from_pickle(
file_path: Union[str, Path]) -> pdpipe.PdPipelineStage:
file_path = util.cached_path(file_path)
with open(file_path, "rb") as fp:
with util.open_file(file_path, "rb") as fp:
pipeline = pickle.load(fp)
return pipeline

Expand Down
6 changes: 3 additions & 3 deletions pdpcli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import pdpipe # pylint: disable=unused-import

from pdpcli.configs import ConfigBuilder
from pdpcli.configs import ConfigBuilder, ConfigReader
from pdpcli.data import DataReader
from pdpcli.exceptions import ConfigurationError
from pdpcli.configs import ConfigReader
from pdpcli.util import open_file
from pdpcli.commands.subcommand import Subcommand

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -67,7 +67,7 @@ def run(self, args: argparse.Namespace) -> None:
pipeline.fit(df)

logger.info("Save pipeline to: %s", args.pipeline)
with open(args.pipeline, "wb") as fp:
with open_file(args.pipeline, "wb") as fp:
pickle.dump(pipeline, fp)

logger.info("Done")

0 comments on commit 244f8e4

Please sign in to comment.