-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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] add cli command to generate schema for code location component types #27169
base: master
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@list_cli.command(name="all-components-schema") | ||
@click.pass_context | ||
def generate_code_location_components_schema(ctx: click.Context) -> None: | ||
"""Builds a JSON schema which ORs the schema for a component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opted for this route rather than trying to assemble an ORed schema ourselves from the existing schema metadata, since this has pydantic do the heavy lifting of combining $defs
, $ref
remapping etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly unclear on what schema is being generated here and whether it's necessary to generate this in a separate command. Could this be constructed inside dagster-dg
from constituent schemas on the individual component types? That would avoid needing to cache a separate piece of data upstack.
"""Builds a JSON schema which ORs the schema for a component | ||
file for all component types available in the current code location. | ||
""" | ||
assert is_inside_code_location_project(Path.cwd()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: pls follow the style of check used in other commands (see cli/scaffold.py
)
Summary
Adds a
dagster-components
CLI command used to generate a schema for component files, which ORs all component types available in a given code location.This schema can be used to type check all component files for a code location.
How I Tested These Changes
New unit test.