Build dataset from python

UserBird
UserBird Dataiker, Alpha Tester Posts: 535 Dataiker
Hello,

Is it possible to build a dataset through a python method ?



Cheers,
Clément
Tagged:

Answers

  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    Yes, you can define a Python recipe with an ouput dataset but no input. Use case could be that you retrieve data from an external API, process it in a Pandas dataframe, and then save it to your output dataset using a dataiku method such as write_with_schema.
  • UserBird
    UserBird Dataiker, Alpha Tester Posts: 535 Dataiker
    The function I was looking for is scenario.build_dataset(). I didn't ask It the proper way ;)
    Thks
  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    OK great! We have some examples in our doc that may help you: https://doc.dataiku.com/dss/latest/api/public/client-python/index.html#examples
  • rmnvncnt
    rmnvncnt Registered Posts: 41 ✭✭✭✭✭
    Regarding this particular function (scenario.build_dataset()), is there a list of accepted parameters for the build_mode keyword argument? I saw that RECURSIVE_BUILD is the default parameter, but is there something similar for non-recursive ones?
  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    Here are the available options:
    /** Rebuild what is required for dependencies */
    RECURSIVE_BUILD,
    /** Only rebuild the dataset directly, ignore the state of the dependencies */
    NON_RECURSIVE_FORCED_BUILD,
    /** Rebuild all recursively, ignore the state of the dependencies */
    RECURSIVE_FORCED_BUILD,
    /** Recursive build, but only build "missing" datasets, don't refresh out of date ones */
    RECURSIVE_MISSING_ONLY_BUILD
  • rmnvncnt
    rmnvncnt Registered Posts: 41 ✭✭✭✭✭
    Thanks a lot!
Setup Info
    Tags
      Help me…