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

Q: export dataset as json #3090

Open
SauravMaheshkar opened this issue Nov 26, 2024 · 1 comment
Open

Q: export dataset as json #3090

SauravMaheshkar opened this issue Nov 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SauravMaheshkar
Copy link

What is the best way to convert a weave dataset to a JSON or a Python sequential type?

At the moment, I use the following snippet as a template:

import json

def export_dataset_as_json(ref: str):
  vals = weave.ref(ref).get().rows.rows
  d = []
  for row in vals:
    d.append(dict(row))
  return json.dumps(d)

export_dataset_as_json(
    ref = "weave:///ml-colabs/ml-frameworks-bot/object/keras_evaluation_dataset:JgPCHXYZcQYjuaVzSRCvrBaFZO1yFM8saj1bUp5zrhw"
)

Feature Request

Something like a to_json() function or add_row() would be ideal. I primarily use this when I have to update a dataset. Happy to open a PR for this 😄

@gtarpenning
Copy link
Member

Hey @SauravMaheshkar, thanks for writing in. Dataset manipulation in python (and in the UI!) is on our internal roadmap. In the meantime I am happy to review a PR if you make one, with the small caveat that the team might end up changing the design when we add a more comprehensive database experience. If you run into any blocking issues i'll be here to assist.

@gtarpenning gtarpenning added the enhancement New feature or request label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants