Unable to access c.Spawner from any other file than jupyterhub_config.py file

I am trying to modularize my code and i have a custom_spawner.py. In that i am trying to assign the options_from_form but i am getting the following

c.Spawner.options_from_form = options_from_form ││ ^^^^^^^^^ ││ AttributeError: 'function' object has no attribute 'Spawner'

Also incase i am extending the kubspawner class to make my own custom_spawner, shouldn’t simply overriding the function option_from_form be sufficient? i tried doing this but the function is not being called for some reason.

any help is much appreciated !

c.Xxx is only for configuration. If you want to modify the spawner you’ll need to subclass it. Here’s an example:

1 Like