Adding Partition by API

Bader
Bader Registered Posts: 46 ✭✭✭✭✭

I tried to add Partition by UI it works fine with no issue when I added dataset.

Currently i'm would like to do the same by using python api. Could you please help :

client = dataiku.api_client()

project = client.get_project("Test")

import_definition = project.init_tables_import("testdb", "testschema","testtable")

prepared_import =import_definition.prepare()

future = prepared_import.execute().

I would like add Partition before creating the dataset.

Best Answer

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker
    Answer ✓

    Hi,

    It is not possible to do this at import time. You may modify the settings of a dataset after creation in order to make it partitioned.

    For that, we advise you to create the dataset, use get_definition() in a notebook, then partition it, use get_definition() again in the notebook to see the differences that are needed to make a dataset partitioned, and then to apply that to your dataset. You'll mostly need to change the partitioningScheme part of the dataset definition.

Answers

Setup Info
    Tags
      Help me…