fix(dataset-list): honor explicit metadata/provider filter#434
Merged
fix(dataset-list): honor explicit metadata/provider filter#434
Conversation
Closes #431 `dataset list --data-set-metadata <k=v>` returned an empty list when the requested metadata diverged from `DEFAULT_DATA_SET_METADATA`, because `createdWithFilecoinPin` was applied as a post-filter even after the explicit metadata filter narrowed the set. Skip the `createdWithFilecoinPin` post-filter when the caller passed `--data-set-metadata` or `--provider-id`. Keep the default filecoin-pin-only filter when neither is set. Replace the empty-state message with one of three variants depending on context: - explicit filter matched nothing - default filter hid existing non-filecoin-pin datasets (suggest --all) - no datasets at all (existing message)
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes dataset list behavior so explicit filters (--data-set-metadata / --provider-id) don’t get unintentionally overridden by the default “created with filecoin-pin” post-filter, and improves empty-state messaging to better reflect why no results are shown.
Changes:
- Skip the
createdWithFilecoinPinpost-filter when an explicit provider/metadata filter is provided. - Add a filter-aware empty-state message (and a
--allhint when the default filter hides results). - Add unit coverage for explicit-filter behavior and the new empty-state messaging paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/data-set/run.ts |
Adjusts list filtering logic and computes a context-sensitive empty-state message. |
src/data-set/display.ts |
Allows callers to provide a custom empty-state message for dataset list rendering. |
src/test/unit/data-set.test.ts |
Adds tests covering explicit filter inclusion and empty message variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rvagg
approved these changes
May 4, 2026
juliangruber
approved these changes
May 4, 2026
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.
Closes #431.
What changed
dataset list --data-set-metadata <k=v>returned empty when the requested metadata diverged fromDEFAULT_DATA_SET_METADATA(source=filecoin-pin,withIPFSIndexing=''), becausecreatedWithFilecoinPinran as a post-filter even after the explicit metadata filter already narrowed the set. Now the post-filter is skipped when the caller passed--data-set-metadataor--provider-id. Behavior with no flags is unchanged.The empty-state message now distinguishes three cases:
--allHow to verify
Manual: