Community Conundrums are live! Learn more

Adding Partition by API

Level 1
Adding Partition by API
Jump to solution

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. 

0 Kudos
2 Replies
Level 1
Author

Could you please provide example 

 

 

0 Kudos
Dataiker
Dataiker

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.

0 Kudos
Labels (2)