Skip to content

Commit

Permalink
remove tmp_target_url
Browse files Browse the repository at this point in the history
  • Loading branch information
ranchodeluxe committed Jan 25, 2024
1 parent 6979092 commit 6af025e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_store_dataset_fragment(temp_store):
def test_zarr_consolidate_metadata(
netcdf_local_file_pattern,
pipeline,
tmp_target_url,
tmp_target,
):
pattern = netcdf_local_file_pattern
with pipeline as p:
Expand All @@ -166,22 +166,22 @@ def test_zarr_consolidate_metadata(
| beam.Create(pattern.items())
| OpenWithXarray(file_type=pattern.file_type)
| StoreToZarr(
target_root=tmp_target_url,
target_root=tmp_target,
store_name="store",
combine_dims=pattern.combine_dim_keys,
consolidated_metadata=False,
)
| ConsolidateMetadata()
)
zc = zarr.storage.FSStore(os.path.join(tmp_target_url, "store"))
zc = zarr.storage.FSStore(os.path.join(tmp_target.root_path, "store"))
assert zc[".zmetadata"] is not None


@pytest.mark.parametrize("output_file_name", ["reference.json", "reference.parquet"])
def test_reference_netcdf(
netcdf_local_file_pattern_sequential,
pipeline,
tmp_target_url,
tmp_target,
# why are we not using tmp_target?
output_file_name,
):
Expand All @@ -194,15 +194,15 @@ def test_reference_netcdf(
| OpenWithKerchunk(file_type=pattern.file_type)
| WriteCombinedReference(
identical_dims=["lat", "lon"],
target_root=tmp_target_url,
target_root=tmp_target,
store_name=store_name,
concat_dims=["time"],
output_file_name=output_file_name,
)
| ConsolidateMetadata()
)

full_path = os.path.join(tmp_target_url, store_name, output_file_name)
full_path = os.path.join(tmp_target.root_path, store_name, output_file_name)

mapper = fsspec.get_mapper("reference://", fo=full_path)
assert zarr.open_consolidated(mapper)

0 comments on commit 6af025e

Please sign in to comment.