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

Exporting dataset with empty cells causes data loss #33

Open
heggemsnes opened this issue Jan 15, 2024 · 4 comments
Open

Exporting dataset with empty cells causes data loss #33

heggemsnes opened this issue Jan 15, 2024 · 4 comments

Comments

@heggemsnes
Copy link

Describe the bug

Doing sanity dataset export when using this plugin removes empty cells, causing the two dimensional arrays to be shifted

To Reproduce

Add some data with in a table with empty cells. Do a dataset export and notice the empty cells are gone.

Expected behavior

Empty cells should show up in the export.

@matthewwyndham
Copy link

Surprisingly, running an export via Sanity's HTTP API works perfectly, resulting in data like below:

{
  "_type":"tableRow",
  "cells":["nice","nine","","very nice"]
},

where the empty cells returned "" as expected.

BUT running npx sanity dataset export results in data as you mentioned, where the data in the cell is fully gone:

{
  "_type":"tableRow",
  "cells":["nice","nine","very nice"]
},

So you could use the curl command as a workaround for now:

curl https://$(PROJECT_ID).api.sanity.io/v2021-06-07/data/export/$(DATASET_NAME)/ > backup.ndjson

@orjanmjelde-kantega
Copy link

Hi, we have been running into the same problem in our project, and I wondered if there has been opened any ticket with Sanity regarding this issue?

I would guess the issue is related to the export feature of sanity cli, and not the plugin?

@matthewwyndham
Copy link

I have not seen a ticket with sanity, if it is happening in multiple places then please make a ticket and quote this issue as well!

@orjanmjelde-kantega
Copy link

Ticket registered: sanity-io/sanity#7511

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

3 participants