https://meltano.com/ logo
#cli
Title
# cli
m

mammoth-napkin-71897

02/22/2022, 10:32 PM
Is there any concept of ‘hooks’ in Meltano?
m

modern-activity-11759

02/22/2022, 10:54 PM
Hi @mammoth-napkin-71897! In what context do you mean? Meltano does use its own form of hooks internally, for example to create temp config and catalog files for Singer, and for cleaning those up.
m

mammoth-napkin-71897

02/22/2022, 11:45 PM
I suppose mostly in terms of attaching supporting processes to CLI operations…
sorry that’s vague. But a more specific example might be triggering a small bash script before or after
meltano elt …
, for example.
Maybe a ‘Utility’ plugin is what im looking for.
And maybe in conjunction with the new
meltano run
command
💪 1
s

salmon-salesclerk-77709

02/23/2022, 3:04 AM
@mammoth-napkin-71897 you’ll probably be interested in https://gitlab.com/meltano/meltano/-/issues/2813 and some of the related issues
👍 1
f

flat-bear-81546

02/23/2022, 3:37 AM
I also wonder if meltano run does what you want here? This works or will work at some point
meltano run prehook tap-name target-name posthook
although I'm kinda abusing things a bit here this is one of the ideas of meltano run!
👍 1
m

mammoth-napkin-71897

02/23/2022, 4:43 PM
@flat-bear-81546 - Yeah, I think that’s basically what I was referring to w/
meltano run
in conjunction with creating some Utility plugins to expose cli’s that
meltano run
can use.
That would work super well.
Really excited for
meltano run
f

flat-bear-81546

02/23/2022, 4:45 PM
Right now just
Copy code
#/bin/bash
./prehook.sh
meltano elt tap-name target-name
./posthook.sh
Or use airflow or whatever 🙂
m

mammoth-napkin-71897

02/23/2022, 4:49 PM
By the way, just to throw an idea out there (and I’m happy to write this up as a ticket if it seems interesting enough): I know that Kedro uses pytests’s https://pluggy.readthedocs.io/en/latest/ as a basis for its own hook system… Assuming I understand correctly how pluggy works, I think one could imagine a Hook plugin type in Meltano where the plugin author would have say a dozen entrypoints to override.