Join the Kedro community

Updated last week

Disabling kedro hooks when running kedro viz

Hi Team,

Is there a way to not run certain kedro hooks when kedro viz loads? I have a spark hook defined which runs everytime I run kedro viz which I want to disable.

Thanks! πŸ™‚

1
A
d
R
19 comments

This Hall app is crazy eager to find similar slack posts (but totally misses the point of my post)

which version of Kedro Viz are you running?

also kedro viz --lite may be what you're looking for

ah maybe it's this, I think this would work:

DISABLE_HOOKS_FOR_PLUGINS = ("kedro-viz",)

But doesn't give me the flexibility to disable a particular hook though I think

does kedro viz --lite not work for your purposes?

Yes, I think it does the job too. Thanks for this option πŸ™‚

I love this new feature because it also doesn't require you to have any dependencies installed

it just looks at the pipeline code at an AST level and builds the graph

Wow, this would be super helpful! So I can technically run it from any environment, which is great!

Just need kedro and kedro viz installed?

Btw, which Kedro-version are you on because on version from Kedro-viz 9.0.0 , hooks are not called by default and you need to do kedro viz --include-hooks to actually run kedro-viz with hooks

i just saw ur message above. that' is weird 😐

kedro 18 😞
On some projects I am on kedro 19, on others it is kedro 18 still haha

As Rashida mentioned from kedro viz 9.0.0 we ignore hooks by default unless you run kedro viz --include-hooks . I would like to know if you are registering the SparkHook similar to the doc here ? If you are still bumping into the issue, would you be happy to open an issue here with required information to reproduce.

Ah I just realised, the spark session initialization is part of ProjectContext in our case, so no way to disable it unless I refactor it to a hook
That's why I was perplexed as to why my spark session is being initialized even though I disabled all the hooks πŸ˜…

Okay - but β€”lite solves your problem either way

Add a reply
Sign up and join the conversation on Slack