https://dagster.io/ logo
Title
d

Dan Stoner

09/16/2021, 7:50 PM
Looking for "how to organize my git repo" help. 'repository' of course being an overloaded concept here. I want to run
dagit
without any additional args so I have been trying to get
workspace.yaml
working but now I'm in what seems like Python import hell. I have an existing sample that works fine with
dagit -f hello_dagster.py
and all I want to do is move that into a subdirectory and have it available when running just
dagit
.
UserWarning: Error loading repository location repositories.py:dagster.core.errors.DagsterInvalidDefinitionError: Bad return value from repository construction function: all elements of list must be of type PipelineDefinition, PartitionSetDefinition, ScheduleDefinition, or SensorDefinition. Got value of type <class 'module'> at index 0, value of type <class 'module'> at index 1.
Maybe I am shooting myself in the foot by trying to use the Experimental APIs. My
hello_dagster.py
has no
@pipeline
annotation (even though when I run it after starting via
dagit -f
the UI shows pipeline named
do_it_all
)
Here are contents of `hello_dagster.py`:
from dagster import graph, op

@op
def do_something():
    print("Hello Dagster!")

@graph
def do_it_all():
    do_something()


if __name__ == "__main__":
    do_it_all()
Also, just in general... the examples in the doc indicate an awful lot of boilerplate is required... repo.py having to both import every individual thing (pipeline?) and then also return them. I guess this makes everything explicit but somewhat different than "here is my dags folder"
😳 I just found this: https://docs.dagster.io/getting-started/create-new-project which has a repo layout. Will try that.
m

max

09/16/2021, 8:18 PM
@prha
p

prha

09/16/2021, 10:18 PM
@Dan Stoner yeah, the idea with making it explicit is that you might have different repositories (for different environments) but containing the same graphs. We’re in the process of solidifying a lot of the experimental API support (including docs and the CLI scaffolding).