What is the difference between import_bundle_from_archive to import_bundle_from_stream?

arielma2304
arielma2304 Registered Posts: 47 ✭✭✭✭

Hi

I trying to understand the difference between those 2 methods, and when we suppose to use each one.

Per this example:

Automate-bundle-export-import-python-script

We are using import_bundle_from_archive when choosing export option of download_exported_bundle_archive_to_file

when we need to use it?

Answers

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    Hi @arielma2304
    ,

    The difference between the two is that in

    import_bundle_from_archive - you pass an archive path as a parameter and then the server will read it's content.

    whereas in

    import_bundle_from_stream - you provide the actual bundle content as a parameter, the server doesn't read it from the path.

    Regards,

  • arielma2304
    arielma2304 Registered Posts: 47 ✭✭✭✭

    What archive path means?

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    It's the path used when the bundle was exported from design node.

    There are some examples here

    https://community.dataiku.com/t5/Using-Dataiku-DSS/Automate-bundle-export-import-python-script/m-p/2229

  • arielma2304
    arielma2304 Registered Posts: 47 ✭✭✭✭

    but both methods gets at the end zip file of the exported bundle, so when each method should be used?

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    I'm not sure I understand your last point about parameters being the same. Semantically they indeed represent the same thing - an exported bundle, but either you provide a path to the file or this file's content.

    If your design and automation nodes are deployed to the same machine you can use import_bundle_from_archive and just pass the file path.

    If they're on different machines then you'd have to read the file and pass it using import_bundle_from_stream

Setup Info
    Tags
      Help me…