https://kedro.org/ logo
#questions
Title
# questions
a

Afaque Ahmad

11/25/2022, 6:53 AM
Hi Team, I've created a method called
get_spark
inside the
ProjectContext
which I need to access in the
register_catalog
hook. How can I access that function?
d

datajoely

11/25/2022, 10:17 AM
Is this < 0.18.x? The modern way to do this is the
after_context_created
hook
m

Merel

11/25/2022, 10:18 AM
What version of Kedro are you using? The registration hooks were removed for the
0.18.0
series
ahhh @datajoely faster as always 😂 🚀
d

datajoely

11/25/2022, 10:19 AM
🚤
a

Afaque Ahmad

11/25/2022, 10:21 AM
I'm using
0.17.4
How to do it for this version of Kedro?
d

datajoely

11/25/2022, 10:26 AM
I think the catalog may already be registered by the time the context is instantiated. Can you not access it via self.catalog?
a

Afaque Ahmad

11/25/2022, 11:13 AM
I'm in the
register_catalog
hook, so I think its just before being registered.
d

datajoely

11/25/2022, 11:14 AM
so you either have to create a session just for this or find a diff approach
or upgrade!
2 Views