Using a Code Repositories library in a Code Workbook

477 views Asked by At

Is it possible to build a library using Code Repositories and then call that library in a Code Workbook?

2

There are 2 answers

0
Adil B On

Yes. You need to ensure that the shared channel that libraries are published to from Code Repositories is configured in the Code Workbook profile's conda-environment.shared-channel-dependencies setting.

Please work with your Palantir Support Team to get this backend configuration change made.

0
ZygD On

This is a simple way to do it for testing purposes.

Create the library

  1. Create the repository of Python Library type:

    enter image description here

  2. Add the function:

    enter image description here

  3. You can inspect the library name in the file gradle.properties.
    Note: underscores _ will be translated into hyphens -

    enter image description here

  4. Commit and pull into the master branch.

  5. Create a new tag (necessary) and wait until Checks pass.

    enter image description here

    enter image description here


Create Code Workbook

  1. Create a new code workbook in the same project:

    enter image description here

  2. "Environment" -> "Customize Spark environment".

    enter image description here

  3. Click "Customize profile".

  4. Search for and add your library:

    enter image description here

  5. Click "Update environment" and wait until the customized environment initializes.


Result

enter image description here