Skip to content

'data' key not required; can be any friendly name.#710

Merged
gitosaurus merged 1 commit intomainfrom
dtj-pydantic-fix
Feb 19, 2026
Merged

'data' key not required; can be any friendly name.#710
gitosaurus merged 1 commit intomainfrom
dtj-pydantic-fix

Conversation

@gitosaurus
Copy link
Contributor

Discovered while testing pre-executed notebooks.

Solution Description

Previous testing incorrectly assumed that in a data request, the data source name had to be called 'data' if there weren't multiple sources. This is not true. Corrected both test and logic.

Code Quality

  • I have read the Contribution Guide and agree to the Code of Conduct
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Previous testing incorrectly assumed that in a data request,
the data source name had to be called 'data' if there weren't
multiple sources.  This is not true.  Corrected both test and
logic.
Copilot AI review requested due to automatic review settings February 19, 2026 18:52
@gitosaurus gitosaurus requested a review from drewoldag February 19, 2026 18:54
@gitosaurus gitosaurus enabled auto-merge (squash) February 19, 2026 18:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the DataRequestDefinition.as_dict() method where dictionary-based dataset configurations (multiple datasets with friendly names) were incorrectly being wrapped with an extra "data" key. The fix ensures that when exporting configurations with multiple datasets, the friendly names (like "cifar_0", "cifar_1", "random") are used directly as keys, matching the expected format used in notebooks and documentation.

Changes:

  • Corrected the as_dict() method to not wrap dict configs in an extra "data" key
  • Updated test assertions to match the corrected behavior
  • Updated comment to clarify that dict config keys are "already friendly names"

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/hyrax/config_schemas/data_request.py Fixed as_dict() method to not wrap dict configs in extra "data" key, preserving friendly names directly
tests/hyrax/test_data_request_config.py Updated test assertions to match corrected dict config structure without nested "data" key

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.17%. Comparing base (4c93171) to head (4b4d037).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #710   +/-   ##
=======================================
  Coverage   64.17%   64.17%           
=======================================
  Files          61       61           
  Lines        5892     5892           
=======================================
  Hits         3781     3781           
  Misses       2111     2111           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

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

This looks correct to me. I made a similar change in PR #690. I'll pull these changes in when they land on main.

@gitosaurus gitosaurus merged commit 464960b into main Feb 19, 2026
15 checks passed
@gitosaurus gitosaurus deleted the dtj-pydantic-fix branch February 19, 2026 18:59
@github-actions
Copy link

Before [4c93171] After [375d5bb] Ratio Benchmark (Parameter)
failed failed n/a vector_db_benchmarks.VectorDBInsertBenchmarks.time_load_vector_db(16384, 'qdrant')
1.89±0.08s 1.96±0.02s 1.04 benchmarks.time_train_help
1.90±0.07s 1.96±0.01s 1.03 benchmarks.time_save_to_database_help
9.15±0.01ms 9.44±0.07ms 1.03 vector_db_benchmarks.VectorDBSearchBenchmarks.time_search_by_vector_many_shards(128, 'chromadb')
1.91±0.07s 1.95±0.01s 1.02 benchmarks.time_rebuild_manifest_help
1.94±0.05s 1.97±0.02s 1.02 benchmarks.time_umap_help
7.37±0.02s 7.49±0.01s 1.02 data_cache_benchmarks.DataCacheBenchmarks.time_preload_cache_hsc1k
3.42±0.01s 3.50±0.05s 1.02 vector_db_benchmarks.VectorDBInsertBenchmarks.time_load_vector_db(256, 'chromadb')
3.18±0.02s 3.24±0.04s 1.02 vector_db_benchmarks.VectorDBInsertBenchmarks.time_load_vector_db(64, 'chromadb')
9.41±0.1ms 9.56±0.1ms 1.02 vector_db_benchmarks.VectorDBSearchBenchmarks.time_search_by_vector_many_shards(64, 'chromadb')

Click here to view all benchmarks.

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.

2 participants

Comments