Skip to content

Commit

Permalink
fix: use path.as_uri instead of str(path)
Browse files Browse the repository at this point in the history
  • Loading branch information
dymbe committed Mar 20, 2024
1 parent fdfcc4f commit a14be67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data_pipelines/resources/io_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def dump_to_path(
self, context: OutputContext, obj: xr.DataArray, path: UPath
) -> None:
obj.to_zarr(
str(path),
path.as_uri(),
mode="w",
storage_options=dict(path.storage_options),
)
Expand All @@ -77,12 +77,12 @@ def dump_to_path(
match obj:
case pd.DataFrame:
obj.to_parquet(
str(path),
path.as_uri(),
storage_options=path.storage_options,
)
case dd.DataFrame:
obj.to_parquet(
str(path),
path.as_uri(),
storage_options=path.storage_options,
)
case _:
Expand All @@ -91,7 +91,7 @@ def dump_to_path(
def load_from_path(
self, context: InputContext, path: UPath | Sequence[UPath]
) -> dd.DataFrame:
return dd.read_parquet(str(path))
return dd.read_parquet(path.as_uri())

def load_input(self, context: InputContext) -> dd.DataFrame:
if not context.has_asset_partitions:
Expand Down

0 comments on commit a14be67

Please sign in to comment.