feat: Allow schema paths/objects to be passed to API functions#74
Open
effigies wants to merge 24 commits into
Open
feat: Allow schema paths/objects to be passed to API functions#74effigies wants to merge 24 commits into
effigies wants to merge 24 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
+ Coverage 95.15% 95.66% +0.51%
==========================================
Files 7 8 +1
Lines 495 531 +36
==========================================
+ Hits 471 508 +37
+ Misses 24 23 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Yes, please, if you have benchmarks I would be happy to add them to my success criteria while contributing to this project. |
Contributor
Author
|
The test failure is due to a misconfiguration of "Pytest coverage comment": https://github.com/childmindresearch/bids2table/actions/runs/25566684415/job/75051826576?pr=74 |
bb953e5 to
977e0ba
Compare
977e0ba to
6fb748f
Compare
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backwards-incompatible break of the current API.
Along the lines of #70 (comment), this introduces a public type:
This allows a schema reference or schema object to be passed to any of:
validate_bids_entitiesget_arrow_schemaget_column_namesindex_datasetbatch_index_datasetThese functions turn the schema spec into a
BIDSSchemaAdapterobject, which encapsulates the components that are used by bids2table, and should be extensible going forward:The only current direct consumer is:
The only current consumer of
pa.Schemais:Which is called by the dataset indexer and the public API function
validate_bids_entities. The main reason for this indirection is thatpa.Schemais passed to_index_dataset_subject_dirand I didn't want to refactor that more than necessary, but this seems like a good, future-thinking approach anyway: By pulling the validation metadata out of the pyarrow schema, a parquet file contains what is needed to validate itself, without needing to look up and load the original schema.That said, that isn't done here, and I could refactor these functions to take a
BIDSSchemaAdapter, which will save a round-trip of metadata into and out ofpyarrow.Schema.Closes #70.
Replaces #71.