[Processing tests] Delete a bundle, clean exported_bundles list.

rmnvncnt
rmnvncnt Registered Posts: 41 ✭✭✭✭✭
edited July 18 in Using Dataiku

Hi,

I am developing a python lib for bundle exporting. I am implementing tests on the bundle exporting process and I face a problem concerning the bundles_ids.

For each test session, I start by deleting the test project :


project_test_1_automation = automation.client.get_project('PROJECT_TEST_1')
project_test_1_automation.delete()

I then want to upload a bundle (which recreates the same project).I retrieve the exported bundles on automation thanks to :


bundles = project_test_1_automation.list_exported_bundles()['bundles']
bundle_ids = [b['bundleId'] for b in bundles]

And after that I check that the bundle I want to export is not in exported°bundles in order not to export an existing bundle.


if bundle_name not in bundle_ids:

logging.info("Exporting {} ...".format(bundle_name))

project.export_bundle(bundle_name)

The problem is that the bundle_ids contains all the old ids that were created in the previous tests sessions. So now, it never enters the loop.

I found that on the REST API, it's possible to export and import bundles on automation but there is no endpoints that allows to DELETE a bundle.



Is there a way to clean the list of exported bundles ?

Answers

Setup Info
    Tags
      Help me…