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

DOCS-2631: Add dataset export option CLI #3253

Merged

Conversation

sguequierre
Copy link
Contributor

  • adds dataset export option

attempted to add explanation and usage for the flags which meant formatting a little differently in the table, lmk and I can remove

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Aug 14, 2024
@sguequierre sguequierre requested a review from npentrel August 14, 2024 18:03
docs/cli.md Outdated
@@ -296,6 +296,7 @@ viam data export --destination=<output path> --data-type=<output data type> [...
viam data delete [...named args]
viam data dataset add --dataset-id=<dataset-id> --file-ids=<file-id-or-ids> --location-id=<location-id> --org-id=<org-id> [...named args]
viam data dataset remove --dataset-id=<dataset-id> --file-ids=<file-id-or-ids> --location-id=<location-id> --org-id=<org-id> [...named args]
viam data dataset export --destination=<output-directory> --datasetFlagDatasetID=<dataset-id>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

destination already included export in "named arguments" @tahiyasalam LMK if this needs correcting, a bit confused about flags not being renamed to simple names like destination is

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure you install the latest version of the CLI and check it to get this information:

(viam-docs) ➜  viam-docs git:(viam-agent-full) ✗ viam dataset export
NAME:
   viam dataset export - download data from a dataset

USAGE:
   viam dataset export --destination=<destination> --dataset-id=<dataset-id> [other options] include-jsonl parallel

OPTIONS:
   --dataset-id value   dataset ID of the dataset to be downloaded
   --destination value  output directory for downloaded data
   --include-jsonl      option to include JSON Lines files for local testing (default: false)
   --parallel value     number of download requests to make in parallel (default: 100)

Error: Required flags "destination, dataset-id" not set

Alternatively, the information is also in app.go. The lines that set the name parameters are:

You can search for the variable name and see where it is getting included to find out more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I wasn't aware of this and was struggling to find. Will update!

docs/cli.md Outdated
@@ -340,6 +341,7 @@ done
| `database hostname` | Get the MongoDB Atlas Data Federation instance hostname and connection URI. See [Configure data query](/use-cases/sensor-data-query-with-third-party-tools/#configure-data-query) | - |
| `dataset add` | Add a new image to an existing dataset by its file id, or add a group of images by specifying a filter | `filter` |
| `dataset remove` | Remove an existing image from a dataset by its file id, or remove a group of images by specifying a filter | `filter` |
| `dataset export` | Download all the data from a dataset | `datasetFlagDatasetID`: Dataset ID of the dataset to download. To retrieve these IDs, navigate to your dataset’s page in the [Viam app](https://app.viam.com), click **…** in the left-hand menu, and click **Copy dataset ID**.</li><li>`datasetFlagIncludeJSONLines`: Set to `true` to include JSON Lines files for local testing. _(optional)_</li><li>`dataFlagParallelDownloads`: Number of download requests to make in parallel. _(optional)_ Default: `100`</li></ul> |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now that I look at this again, these are named arguments that should go in the named arguments table below. not in this table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup sounds good will fix, thanks naomi

@sguequierre sguequierre requested a review from npentrel August 15, 2024 15:23
@viambot
Copy link
Member

viambot commented Aug 15, 2024

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/3253

@sguequierre sguequierre changed the title DOCS-2631: Add dataset export option DOCS-2631: Add dataset export option CLI Aug 16, 2024
| `--data-type` | Data type to be downloaded: either binary or tabular |`export`| **Required** |
| `--component-name` | Filter by specified component name |`export`, `delete`| Optional |
| `--component-type` | Filter by specified component type |`export`, `delete`| Optional |
| `--component-model` | Filter by specified component model |`export`, `delete`| Optional |
| `--dataset-id` | Dataset to add or remove images from |`dataset`| **Required** |
| `--dataset-id` | Dataset to add or remove images from or download. To retrieve these IDs, navigate to your dataset’s page in the [Viam app](https://app.viam.com), click **…** in the left-hand menu, and click **Copy dataset ID**. | `dataset`, `dataset export` | **Required** |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@sguequierre sguequierre merged commit 1da8f44 into viamrobotics:main Aug 19, 2024
9 checks passed
@sguequierre sguequierre deleted the DOCS-2631/cli-create-dataset-file branch August 19, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants