https://dagster.io/ logo
k

Keval

05/25/2020, 8:30 PM
Is it possible to define global Solid which can be used in any file by just calling it? Something like we just import file and call that solid in DAG file. More real life example If I made
read_csv
solid do I have to copy paste every where in each project where I want to use it or there is any solution to import solids an use them?
a

alir

05/26/2020, 3:10 PM
Hi keval, I'm not sure what you tried but it should absolutely be possible to define a solid once in a .py file, import it in other places, and re-use them across pipeines
k

Keval

05/26/2020, 8:11 PM
Hi @alir I tried that way but getting error
a

alir

05/26/2020, 8:12 PM
have you tried
mylib.hello_cereal()
?
in
hello_cereal_pipeline
k

Keval

05/26/2020, 8:13 PM
I think I was missing two things. 1. Placing all import statements in
mylib.py
2. calling it like you suggested
mylib.hello_cereal()
and after changing that it worked. Thanks
Thanks for your help @alir
a

alir

05/26/2020, 8:17 PM
you're welcome. glad it works!