Daniel Mosesson
07/08/2022, 10:29 AMdir(my_package)
I do see things that are of type RepositoryDefinition
The only error I see in dagit is dagster.core.errors.DagsterInvariantViolationError: No repositories, jobs, pipelines, graphs, asset groups, or asset definitions found in "my-package"
The error is coming from the right venvprha
07/08/2022, 4:28 PMworking_directory
argument. By default, dagit uses its own working directory as the base path to resolve local imports.
Also, pasting this doc section in case you haven’t seen it: https://docs.dagster.io/concepts/repositories-workspaces/workspaces#workspacesDaniel Mosesson
07/08/2022, 4:38 PMload_from:
- python_package: my_package
enexecutable: /absolute/path/to/venv/bin/python
prha
07/08/2022, 4:44 PMDaniel Mosesson
07/08/2022, 4:46 PMpkg_resources
(which for some reason did not get created as part of the venv
, so I just patched it)prha
07/08/2022, 5:18 PMinspect.getmembers
calls on the module and doing isinstance checks to look for `RepositoryDefinition`…. I’m curious what it’s able to find in your loaded moduleDaniel Mosesson
07/08/2022, 5:25 PMDaniel Mosesson
07/08/2022, 5:25 PMisinstance(inspect.getmembers(my_module)[-6][1],RepositoryDefinition)
returns trueprha
07/08/2022, 5:29 PMfrom dagster.core.workspace.autodiscovery import loadable_targets_from_python_package
loadable_targets_from_python_package("my-package")
do you get the invariant error?Daniel Mosesson
07/11/2022, 11:03 AMmissing 1 required positional argument: 'working directory'
Daniel Mosesson
07/11/2022, 11:09 AM/full/path/to/dagster/home
as the working directory (it should not matter for this package) in the venv returns a list of LoadableTarget
with what looks like all the reposDaniel Mosesson
07/11/2022, 11:10 AMDaniel Mosesson
07/11/2022, 5:24 PMprha
07/11/2022, 8:08 PMNone
to the working directory arg. Other than that, are you able to run this code through a debugger and see what the difference is in the environment?Daniel Mosesson
07/12/2022, 4:34 AMDaniel Mosesson
07/12/2022, 8:07 AMmy-package
, and that is what I put in the workspace.yaml file.
When I import it manually (and what importlib does as well) is pass it my_package
. If you pass importlib my-package
, inspect.getmembers
returns an object that has a NamespaceLoader
and not the package fully loaded already. Since the package isn't "fully loaded", there are no assets to see there yet. Fixing the entry in the workspace.yaml file to my_package
fixes the issueprha
07/12/2022, 4:39 PM