Hello. I'm trying to use ShellTask locally on Wind...
# prefect-community
m
Hello. I'm trying to use ShellTask locally on Windows using Prefect core, but I'm having issues. I found this old Issue on Github saying that ShellTask isn't windows-compatible. Is there a fix or any workaround?
The end goal here is to execute a
dbt run
command. I tried dbt task library, but it's a child of ShellTask class, so the same issue...
k
Check this. You need bash on your path to use it
But you can also maybe use your own
os.subprocess
call inside a task
m
Thanks for the reply, but it didn't fixt it
k
What error do you get?
m
The task itself runs, but my
helper_script
is not executed in the directory I'm in; it's executed in the directory in the screenshot; therefore I get directory doesn't exist
k
What if you made a task that does this instead?
Copy code
subprocess.call('ls', shell=True, cwd='path/to/wanted/dir/')
m
it doesn't recognize ls
'ls' is not recognized as an internal or external command,...
k
That just an example. Try
dir
for Windows
m
Oh, What you're suggesting is avoiding ShellTask, and using subprocess instead all together?
k
Yeah inside a task
m
I can solve my problem with subprocess. Thanks Are there limitations in using subprocess instead of ShellTask? Like I mentioned, our use-case for ShellTask is not complicated, just running dbt (
run dbt --some_optinos
)