Skip to content

feat: filter verified samples in CSV export - #30

Merged
danellecline merged 3 commits into
mainfrom
feat/issue-29-filter-verified-export
Jul 31, 2026
Merged

feat: filter verified samples in CSV export#30
danellecline merged 3 commits into
mainfrom
feat/issue-29-filter-verified-export

Conversation

@danellecline

Copy link
Copy Markdown
Member

Summary

Adds a --verified-only flag to scripts/export_dataset_csv.py so unverified
samples can be excluded when exporting a dataset to CSV.

  • Samples missing the verified field, or with it set to False, are excluded.
  • If the dataset has no verified field at all, the flag is a no-op with a warning.
  • Also adds scripts/set_verified.py (previously untracked) which is the
    companion script that sets verified=True on samples.

Closes

Closes #29

Testing

  • Added tests/test_export_dataset_csv.py covering the filter and CSV field
    exclusion logic against a real in-memory FiftyOne dataset.
  • Full suite: 95 passed (pytest tests/).

Docs

  • Added a "Scripts" section to README.md documenting both scripts and the
    new flag.

Add scripts/export_dataset_csv.py and scripts/set_verified.py (previously
untracked one-off utility scripts) and add a --verified-only flag to the
export script so unverified samples can be excluded from CSV exports.
Samples missing the `verified` field are treated as unverified. Includes
unit tests and README documentation.

Closes #29

Co-authored-by: Cursor <cursoragent@cursor.com>
@danellecline danellecline added scope/app Changes to src/app impact/medium Moderate behavior or API surface status/needs-review Ready for human review type/feature New capability labels Jul 27, 2026
Add a 'Verified only' checkbox next to Force sync in the launcher applet.
Threads a new verified_only param through POST /sync -> enqueue_sync ->
run_sync_job -> sync_project_to_fiftyone -> build_fiftyone_dataset_from_crops
/ reconcile_dataset_with_tator -> _create_sample_from_loc. When enabled, only
localizations whose 'verified' attribute is truthy are included when
building/reconciling the FiftyOne dataset (missing/False = excluded).

Refs #29

Co-authored-by: Cursor <cursoragent@cursor.com>
@danellecline

Copy link
Copy Markdown
Member Author

Follow-up: added a "Verified only" checkbox to the sync launcher UI

In addition to the CSV export flag, added the equivalent filter to the web applet:

  • New Verified only checkbox next to Force sync in the launcher template (src/app/launcher_template.py).
  • New verified_only query param on POST /sync, threaded through enqueue_sync -> run_sync_job -> sync_project_to_fiftyone -> build_fiftyone_dataset_from_crops / reconcile_dataset_with_tator -> _create_sample_from_loc.
  • When enabled, only localizations whose verified attribute is truthy are included when building or reconciling the FiftyOne dataset (missing/False = excluded). This does not retroactively remove already-synced samples that later become unverified — it only affects newly created/added samples.
  • Added tests/test_verified_only_filter.py (9 tests) covering _loc_is_verified, _create_sample_from_loc, and that reconcile_dataset_with_tator forwards the flag correctly.
  • Updated README.md query-parameter table and config docs.

Full suite: 104 passed (pytest tests/).

…s set

reconcile_dataset_with_tator now retroactively drops dataset samples whose
elemental_id still exists in Tator but whose verified attribute flipped to
False/missing, when verified_only is enabled. Such samples are not re-added
by the add-new-samples step, since _create_sample_from_loc rejects them
again for the same reason. Behavior is unchanged when verified_only is off.

Refs #29

Co-authored-by: Cursor <cursoragent@cursor.com>
@danellecline
danellecline merged commit 157341c into main Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact/medium Moderate behavior or API surface scope/app Changes to src/app status/needs-review Ready for human review type/feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter verified in export

1 participant