https://dagster.io/ logo
#announcements
Title
# announcements
j

James

08/19/2020, 4:04 PM
Fogive the basic question, but import pain is driving me nuts:
Copy code
WORKS:
dagster pipeline execute -f module1/submodule1/submodule2/submodule3.py
                         -a my_fancy_repo 
                         -p my_fancy_pipeline
                         --mode some_mode
                         -c config.yaml

IMPORT ERROR: no module named module1
dagster pipeline execute -m module1.submodule1.submodule2.submodule3
                         -a my_fancy_repo 
                         -p my_fancy_pipeline
                         --mode some_mode
                         -c config.yaml
Running from the root folder containing
module1
. All cross imports in submodules are of the format
from module1.submodule1.... import a, b, c
. Tearing my hair out trying to understand why the behaviour is different. Tried to use
-d
but get
Error: Invalid set of CLI arguments for loading repository/pipeline. See --help for details.
Any ideas much appreciated!
m

max

08/19/2020, 4:12 PM
@prha
p

prha

08/19/2020, 4:12 PM
Strange that
-d
is giving you that error. Can you confirm what version of dagster you’re on?
j

James

08/19/2020, 4:13 PM
Sure, 0.9.1
p

prha

08/19/2020, 4:13 PM
ah right.
j

James

08/19/2020, 4:14 PM
Need to update?
p

prha

08/19/2020, 4:16 PM
No, this is because we disabled using the current working directory to resolve modules.
We should consider allowing you to explicitly specify the working directory though
Do you mind filing an issue on this?
j

James

08/19/2020, 4:21 PM
Sure thing.
p

prha

08/19/2020, 4:23 PM
Thank you for the detailed report!
j

James

08/19/2020, 4:24 PM
Just to clarify, would you expect the call using the module flag to work on its own, or will it require setting the directory flag too?
p

prha

08/19/2020, 4:25 PM
Not quite sure yet… ideally it would work on its own, but this has downstream effects on how the scheduled executions are stored and run
Would want to avoid creating multiple copies of the same schedule, just invoked from different directories
j

James

08/19/2020, 4:30 PM
Great, yea my confusion mainly steps from the fact that running vanilla python modules with
-m
has been my safe haven from import hell!
👍 1
Thanks for the support, and thanks for Dagster!
16 Views