Skip to content

Improvements to 'create' CLI command: rename type arg and add error handling#72

Merged
martindurant merged 2 commits intofsspec:mainfrom
ktaletsk:create-cmd-improvements
Mar 19, 2026
Merged

Improvements to 'create' CLI command: rename type arg and add error handling#72
martindurant merged 2 commits intofsspec:mainfrom
ktaletsk:create-cmd-improvements

Conversation

@ktaletsk
Copy link
Contributor

  • Renamed typespec_type (avoids shadowing the Python builtin)
  • Validate the spec type against the registry before attempting creation
  • Catch NotImplementedError to print a helpful list of which types actually support creation.

- Rename the `type` argument to `spec_type` to avoid shadowing the Python
builtin.
- Validate the spec type against the registry before attempting
creation, and catch NotImplementedError to print a helpful list of which types actually support creation.

@main.command("create")
@click.argument("type")
@click.argument("spec_type")
Copy link
Member

Choose a reason for hiding this comment

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

Elsewhere in the CLI< this is called "types". Should that become "spec_types"?

@martindurant
Copy link
Member

Since we are doing this, should the info path (function call and CLI) be changed to indicate which of the classes support create()? That way, the frontend can show only relevant types.

@martindurant
Copy link
Member

@ktaletsk , I reverted to "type", and the info JSON output now contains a "create": true|false field for each spec type.

@martindurant martindurant merged commit 135cf58 into fsspec:main Mar 19, 2026
2 checks passed
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