Accessing flow variables from within a FS provider?

Options
rmnvncnt
rmnvncnt Registered Posts: 41 ✭✭✭✭✭

I'm currently writing a custom FS provider (see here) and I'd like to use some flow variables into my code. For instance, I'd like to get the project in which the connector is instantiated to customize the path of my data files. I tried naively something like :


from dataiku.fsprovider import FSProvider<BR /><BR />import os, shutil<BR />import dataiku<BR /><BR />class CustomFSProvider(FSProvider):<BR /> <BR /> def __init__(self, root, config, plugin_config):<BR /><BR /> self.root = root<BR /> self.provider_root = plugin_config['base_path']<BR /> <BR /> base_path = os.path.join(self.provider_root, self.root)<BR /> vars = dataiku.dku_flow_variables

But the last line throws an error. Should I use the dataiku api client?

Best,

Romain

Tagged:

Answers

  • fchataigner2
    fchataigner2 Dataiker Posts: 355 Dataiker
    Options
    Hi,

    the `dataiku.dku_flow_variables` is meant for use in recipes, not in plugin datasets. The latter are expected to also run outside recipes, where flow variables don't exist.

    Regards,

    Frederic
  • rmnvncnt
    rmnvncnt Registered Posts: 41 ✭✭✭✭✭
    Options
    Thanks Frederic. So that means that there is no way I can retrieve the project key and the dataset name from within the plugin dataset?
Setup Info
    Tags
      Help me…