Harvey Marshall
09/01/2022, 5:22 PMdagster._core.errors.DagsterInvalidDefinitionError: Bad return value from repository construction function: all elements of list must be of type JobDefinition, GraphDefinition, PipelineDefinition, PartitionSetDefinition, ScheduleDefinition, SensorDefinition, AssetsDefinition, or SourceAsset.Got value of type <class 'module'> at index 0, value of type <class 'module'> at index 1, value of type <class 'module'> at index 2, value of type <class 'module'> at index 3.
Im getting this error when trying to load all my jobs, ops and assets to the repository a little confusing, as I just started with dagster today.jamie
09/01/2022, 5:27 PMHarvey Marshall
09/01/2022, 5:45 PMfrom dagster import repository
from .assets import cereal
from .ops import get_file_size, api_get, load_config
from .jobs import jobs
ALL_ASSETS = [
cereal
]
ALL_OPS = [
get_file_size,
api_get,
load_config
]
ALL_JOBS = [
jobs
]
@repository
def demo_dagster():
definitions = [
ALL_OPS,
ALL_JOBS,
ALL_ASSETS
]
return definitions
jamie
09/01/2022, 6:48 PM@repository
decorated function should return a list of jobs, graphs, assets, etc. not a list of lists (we do handle this case on the backend, but it's not recommended style). What happens if you change your code to
@repository
def demo_dagster():
definitions = [
*ALL_JOBS,
*ALL_ASSETS
]
return definitions
Harvey Marshall
09/02/2022, 6:55 AMdagster._core.errors.DagsterInvalidDefinitionError: Bad return value from repository construction function: all elements of list must be of type JobDefinition, GraphDefinition, PipelineDefinition, PartitionSetDefinition, ScheduleDefinition, SensorDefinition, AssetsDefinition, or SourceAsset.Got value of type <class 'module'> at index 0, value of type <class 'module'> at index 1.
jamie
09/06/2022, 3:09 PM<class module>
and not some more specific type. Usually when this error happens it'll say something like Got value of type <string>
or value of type <int>
etc. is the jobs
in from .jobs import jobs
a single job definition or some other type?