Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[components] Port dagster-dg to use typer #27271

Closed
wants to merge 1 commit into from

Conversation

smackesey
Copy link
Collaborator

@smackesey smackesey commented Jan 22, 2025

Summary & Motivation

Ports dagster-dg to use typer instead of click.

How I Tested These Changes

Unit tests.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@smackesey
Copy link
Collaborator Author

Closing this because ultimately it proved too difficult to port all of dagster-dg's functionality to typer. We do some fairly advanced manipulation of click and I'm not sure it's even possible to express everything we do with typer. In particular:

  • dynamic subcommand generation-- we do this for dagster-dg, and it is "last minute" generation that is dependent on callbacks for the groups in dg component scaffold executing before the subcommands are generated. Couldn't figure out how to do this in typer.
  • The --use-editable-dagster command can optionally take an argument (or be used as a flag). Couldn't figure out how to implement this in typer.
  • Sharing a single set of global options across many different commands without undue repetition surprisingly does not have a typer-native solution. Instead I had to use subsidiary lib typer-di.

Ended up including typer as a dependency but cherry-picking it's functionality rather than making the app a full typer app. See here for where it is introduced: #27311

@smackesey smackesey closed this Jan 31, 2025
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.

1 participant