https://dagster.io/ logo
#dagster-support
Title
# dagster-support
k

Kayvan Shah

05/31/2022, 1:09 PM
In UI only the first repo shows up?
Copy code
from dagster import repository

from demo.jobs.say_hello import say_hello_job
from demo.schedules.my_hourly_schedule import my_hourly_schedule, my_schedule
from demo.sensors.my_sensor import my_sensor, mysensor

from demo.jobs.cereal_diamond import diamond


@repository
def demo():
    """
    The repository definition for this demo Dagster repository.

    For hints on building your Dagster repository, see our documentation overview on Repositories:
    <https://docs.dagster.io/overview/repositories-workspaces/repositories>
    """
    jobs = [say_hello_job]
    schedules = [my_hourly_schedule]
    sensors = [my_sensor]

    return jobs + schedules + sensors


@repository
def cereals():
    jobs = [diamond]
    schedules = [my_schedule]
    sensors = [mysensor]

    return jobs + schedules + sensors
🤖 1
r

rex

05/31/2022, 9:34 PM
how are you loading dagit locally?
if you want to load multiple repositories, you should export the repositories to the top level of your package. Then tell dagit to read from that package. https://docs.dagster.io/concepts/repositories-workspaces/workspaces#loading-via-python-package
k

Kayvan Shah

06/01/2022, 5:20 AM
Yes running all locally for a POC
I did refer the docs for the same But was also following the project structure that is created in one of the basic tutorials
r

rex

06/01/2022, 5:32 AM
yeah - the the
dagster generate new-project
structure, the repository is exported in the top level: https://github.com/dagster-io/dagster/blob/7a3f7f10f673038856bcdf6923921236c3ae125[…]gster/dagster/generate/new_project/new_project/__init__.py.tmpl If you want
cereals
to show, you need to export it to the top level in this file as well.
Copy code
from .repository import demo, cereals
Your
workspace.yaml
is already setup for you to read from the package, so don’t need to change anything there.
k

Kayvan Shah

06/01/2022, 7:07 AM
Yeah. Got it Thanks a lot pal