Skip to content

[FIX] Assign local YAML filename fallback to seeds so named queries find them - #3772

Open
Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
microsoft:mainfrom
feiiiiii5:fix/local-yaml-dataset-name
Open

Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
microsoft:mainfrom
feiiiiii5:fix/local-yaml-dataset-name

Conversation

@feiiiiii5

Copy link
Copy Markdown
Contributor

Fixes #3740.

Description

A local YAML dataset that omits dataset_name gets a filename fallback at the provider/SeedDataset layer, but its seeds keep dataset_name=None. After the dataset is written to memory, named queries cannot find it: get_seeds_async(dataset_name="<stem>") returns 0 rows and get_seed_dataset_names_async() does not list the name, while the dataset itself appears in the provider list. An explicitly named YAML works.

Root cause: the fallback name is decided in LocalDatasetLoader.fetch_dataset_async after SeedDataset._build_seeds has already run, so it never reaches seed.dataset_name, and the memory insert persists the NULL.

The loader now assigns the resolved dataset name to seeds that do not have their own name before returning, matching the per-seed assignment already done by assert_provider.py and local/jailbreak_dataset.py. Explicit dataset-level and per-seed names are unchanged.

Tests and Documentation

New regression cases in tests/unit/datasets/test_local_dataset_loader.py:

  • filename-only YAML with two seeds (one unnamed, one with an explicit per-seed name) is loaded, inserted into a real in-memory SQLite memory, then queried by the filename stem and listed by get_seed_dataset_names_async(); the explicit per-seed name is not overwritten;
  • an explicitly named YAML keeps its previous load/insert/query/list behavior.

Evidence:

# parent revision: 1 failed, 8 passed - assert None == 'filename_only'
# this branch:      9 passed

Also ran 289 related unit tests (seed datasets, local loader, dataset e2e contract, seed dataset provider) and 6 local integration tests; ruff check, ruff format --check, ty check, and build_scripts/check_async_suffix.py pass on the changed files.

Not run: the full unit suite, Windows/Python 3.11, and the full pre-commit set. No documentation change: this fixes an internal naming inconsistency, and the documented load/named-query contract is already what the fix makes true.

…ind them

A local YAML without dataset_name got a filename fallback on the provider/SeedDataset only; seed.dataset_name stayed None, so the memory insert persisted NULL and named queries/listings could not find the dataset. Assign the resolved name to unnamed seeds before returning, matching the per-seed assignment used by the generated and jailbreak loaders.

Fixes microsoft#3740

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Local YAML filename fallback is not assigned to seeds, so the loaded dataset disappears from named queries

1 participant