-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix group kwarg #338
Fix group kwarg #338
Conversation
for more information, see https://pre-commit.ci
for key in refs.keys(): | ||
# has to capture "foo/.zarray", but ignore ".zgroup", ".zattrs", and "subgroup/bar/.zarray" | ||
# TODO this might be a sign that we should introduce a KerchunkGroupRefs type and cut down the references before getting to this point... | ||
if key not in (".zgroup", ".zattrs", ".zmetadata"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@norlandrhagen the only reason I needed the ".zmetadata"
key in the check here is to make one kerchunk parquet test pass. Is it really the case that kerchunk parquet references use different keys than kerchunk json references? Or is that just a mistake in the fake kerchunk parquet data that we create and use in
with open(tmp_path / "refs" / ".zmetadata") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think we were relying on the parquet directory to have a .zmetadata
file so that we could identify the directory containing parquet's as parquet. #278 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let's merge then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I have another bug to fix first...
found_var_names = [] | ||
for key in refs.keys(): | ||
# has to capture "foo/.zarray", but ignore ".zgroup", ".zattrs", and "subgroup/bar/.zarray" | ||
# TODO this might be a sign that we should introduce a KerchunkGroupRefs type and cut down the references before getting to this point... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be cleaner, but is a refactor that can be done afterwards.
This also changes the expected behaviour of
open_virtual_dataset(file, group=None)
(i.e. the default value of thegroup
kwarg) when multiple groups are encountered. It now just opens the root group instead of raising, which is more consistent withxr.open_dataset
.open_virtual_dataset
fails when there is a subgroup #336docs/releases.rst
New functions/methods are listed inapi.rst
New functionality has documentation