Managing Dependency #414
-
When we look at the execution order of dbt models, the python script always runs at the end of all the models.
How can I make this possible ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I guess this probably means |
Beta Was this translation helpful? Give feedback.
-
Many Thanks. I tried this. It works !!
Regards,
Ritab
…On Thu, Jun 23, 2022 at 4:23 PM Meder Kamalov ***@***.***> wrote:
@ritab-snow <https://github.com/ritab-snow> thank you for using fal!
We're about to announce a special type of a fal python script called
"post-hook". In your schema.yml you can have something like:
- name: tfm_trip_aggr
meta:
fal:
post-hook:
- tfm_getzipcode.py
and run fal flow run --experimental-models, then my_post_hook.py will run
after tfm_trip_aggr and before aggr_distance_travelled.
Beware that there are two functions that don't work with post hooks:
write_to_model and write_to_source.
If you would like your Python scripts to write to a data warehouse using
write_to_model, we recommend trying a Python model as @chamini2
<https://github.com/chamini2> suggested. In this case, you can put
tfm_getzipcode.py in your models directory and do a ref to it in
aggr_distance_travelled (even just in comments) and then tfm_getzipcode.py
will run in required order.
—
Reply to this email directly, view it on GitHub
<https://github.com/fal-ai/fal/discussions/414#discussioncomment-3009434>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZDCNAVUH7ADPFLJLVO3BDDVQQ62HANCNFSM5ZNKX36A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
I guess this probably means
tfm_getzipcode
write to the data warehouse? In that case, I would recommend you move to Python Data Models, a new way of writing fal scripts to be represented as a dbt model.