Context of the macro plugin

Solved!
tomas
Level 5
Context of the macro plugin

Hi,

  when I use the macro plugin in Project's macro page or in Scenario, is it possible to access the context of the call inside the macro code? Like get the handle of the project or scenario here:

class MyRunnable(Runnable):

def __init__(self, project_key, config, plugin_config):
"""
:param project_key: the project in which the runnable executes
:param config: the dict of the configuration of the object
:param plugin_config: contains the plugin settings
"""
self.project_key = project_key
self.config = config
self.plugin_config = plugin_config

 

Thanks

0 Kudos
1 Solution
fchataigner2
Dataiker

Hi,

macros don't receive a context, only their settings. You can sort of guess the context from the current working directory, though

View solution in original post

0 Kudos
2 Replies
fchataigner2
Dataiker

Hi,

macros don't receive a context, only their settings. You can sort of guess the context from the current working directory, though

0 Kudos
tomas
Level 5
Author

Thanks for the answer, I was hoping that there is a way. It would be super cool to have it in the future versions, as for example macro dealing with datasets cannot directly access the Project object and thus list the available datasets and its metadata.

 

0 Kudos