02/03/2023, 8:55 PM
Hello and happy Friday! Question, is there currently a way to define assets dynamically? i.e can I write a function that parses through config files and defines assets? Thanks!
02/03/2023, 9:29 PM
I believe the answer is "yes": have your code build a list of
objects, and give that to the
02/03/2023, 10:23 PM
yeah that should totally work. this isn’t an example for assets, but here’s a code snippet showing how to do something similar with ops
02/03/2023, 10:27 PM
Thank you for your replies! I’ve been reading about the op factory above. How do you implement that? Do I need an op or a job to call the op factory function to dynamically create the ops?
02/03/2023, 10:48 PM
you would just call the function X number of times in your python file and store the returned ops/assets in a list. then you could add that list to your Definitions object to see them in dagit
02/03/2023, 10:56 PM
Got it, thank you! The ops factory worked but I’ll try the asset one next.
^worked with assets as well. Thanks!