Skip to content
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

Loading then saving a VCF imported dataset fails with TypeError: expected unicode string, found 130 #991

Closed
benjeffery opened this issue Jan 9, 2023 · 3 comments

Comments

@benjeffery
Copy link
Collaborator

vcf_to_zarr("example.vcf.gz", "vcf.zarr")
ds = sg.load_dataset("vcf.zarr")
sg.save_dataset(ds, "vcf2.zarr")

Currently fails with
TypeError: expected unicode string, found 130
I believe this is due to pydata/xarray#3476 as the workaround suggested there:

    for v in list(ds.coords.keys()):
        if ds.coords[v].dtype == object:
            ds[v].encoding.clear()

    for v in list(ds.variables.keys()):
        if ds[v].dtype == object:
            ds[v].encoding.clear()

prevents this error. I'm not sure there is anything sgkit can do about this - looking into it.

@tomwhite
Copy link
Collaborator

tomwhite commented Jan 9, 2023

See also #852

@benjeffery
Copy link
Collaborator Author

Ahh, nice! Didn't see that, thanks @tomwhite.

@benjeffery
Copy link
Collaborator Author

I can confirm that using sgkit HEAD fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants