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

[dagster-sdf] Add Project Scaffold #23130

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

akbog
Copy link
Contributor

@akbog akbog commented Jul 20, 2024

Summary & Motivation

This PR contains the dagster-sdf scaffolding cli, which helps users quickly scaffold a dagster project from an existing sdf workspace.

dagster-sdf workspace scaffold --project-name {dagster-project-name} --sdf-workspace-dir {path-to-sdf-workspace}

It creates the necessary assets.py, constants.py, definitions.py etc. to get a project off the ground.

Users can then run dagster dev, with DAGSTER_SDF_COMPILE_ON_LOAD=1 to ensure the project is compiled before the information schema is loaded to determine the asset dag.

DAGSTER_SDF_COMPILE_ON_LOAD=1 dagster dev

How I Tested These Changes

See dagster_sdf_tests/cli.

@cmpadden cmpadden removed the request for review from rexledesma July 23, 2024 16:23
@cmpadden
Copy link
Contributor

@akbog when attempting to use the scaffold command with a test sdf project:

$ dagster-sdf workspace scaffold --project-name example_sdf_project --sdf-workspace-dir dagster_sdf_tests/sdf_workspaces/moms_flower_shop
$ cd example_sdf_project/
$ DAGSTER_SDF_COMPILE_ON_LOAD=1 dagster dev

I received this error:

The above exception was caused by the following exception:
pydantic.error_wrappers.ValidationError: 1 validation error for SdfCliResource
workspace_dir
  /Users/colton/src/dagster/python_modules/libraries/dagster-sdf does not contain an workspace.sdf.yml file. Please specify a valid path to an sdf workspace. (type=value_error)

Despite the workspace file being present in the target project:

$ file dagster_sdf_tests/sdf_workspaces/moms_flower_shop/workspace.sdf.yml
dagster_sdf_tests/sdf_workspaces/moms_flower_shop/workspace.sdf.yml: ASCII text

Am I intended to copy the sdf project or workspace file to a new location?

Copy link
Contributor

@cmpadden cmpadden left a comment

Choose a reason for hiding this comment

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

Confirmed working as expected locally, and tests are running green in bk.

I'd like to land this tonight so that you and Nick can leverage this in dogfooding tomorrow! We can continue to iterate if/when things come up. Cheers.

@cmpadden cmpadden merged commit 3b6dce8 into dagster-io:master Jul 24, 2024
1 check passed
@cmpadden cmpadden deleted the ab/dagster-sdf-scaffold branch July 24, 2024 01:42
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