File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -754,7 +754,7 @@ def _create_meta(
754754 else :
755755 p_obj = str (Path (pin_dir_path ) / object_name )
756756 # file is saved locally in order to hash, calc size
757- file_names = save_data (x . _d , p_obj , type , apply_suffix )
757+ file_names = save_data (x , p_obj , type , apply_suffix )
758758
759759 meta = self .meta_factory .create (
760760 pin_dir_path ,
Original file line number Diff line number Diff line change 22from pathlib import Path
33from typing import Any
44
5- from pins ._adaptors import _create_adaptor
5+ from pins ._adaptors import _Adaptor , _create_adaptor
66
77from .config import PINS_ENV_INSECURE_READ , get_allow_pickle_read
88from .errors import PinsInsecureReadError
@@ -120,7 +120,7 @@ def load_data(
120120
121121
122122def save_data (
123- obj , fname , pin_type = None , apply_suffix : bool = True
123+ obj : "_Adaptor | Any" , fname , pin_type = None , apply_suffix : bool = True
124124) -> "str | Sequence[str]" :
125125 # TODO: extensible saving with deferred importing
126126 # TODO: how to encode arguments to saving / loading drivers?
@@ -129,7 +129,10 @@ def save_data(
129129 # as argument to board, and then type dispatchers for explicit cases
130130 # of saving / loading objects different ways.
131131
132- adaptor = _create_adaptor (obj )
132+ if isinstance (obj , _Adaptor ):
133+ adaptor , obj = obj , obj ._d
134+ else :
135+ adaptor = _create_adaptor (obj )
133136
134137 if apply_suffix :
135138 if pin_type == "file" :
You can’t perform that action at this time.
0 commit comments