Managing code samples¶
This guide outlines the lifecycle of a code sample in the Enterprise Asset Library: creating the sample, reviewing it, updating it, and reusing it in DSS code creation flows.
Creating a code sample¶
To create a code sample, you must have Contributor rights on the specific collection where you wish to add the asset.
Open the Enterprise Asset Library. Click into the target Collection. There are two ways to start creating a code sample:
Standard Method: Click “New Asset” in the top right corner and select “Create code sample” from the dropdown menu.
Empty State Method: If the collection does not contain any code samples yet, navigate to the Code Samples tab. A “Create code sample” button will be available in the center of the screen.
A modal will appear requiring the following information:
Sample title: The display name for the code sample.
Description: A brief summary of the sample’s purpose.
Tags: Organize your sample using keywords. You may create new tags or select existing tags previously used on other code samples.
Type: The code sample type, for example Python, R, SQL, Shell, Scala, Pig, or supported webapp types. Available types depend on your DSS configuration and enabled features.
Additional documentation: Optional explanatory text displayed alongside the code sample.
Variations: One or more code variants for the sample. Some sample types support multiple predefined variations.
Click “Create” to save the new asset. The code sample will immediately appear inside the Code Samples tab.
Viewing and editing code samples¶
Code samples are managed directly within the Code Samples tab of a Collection. The actions available to you depend on your permission level for that specific collection. Users with Reader rights can browse the Code Samples tab and click on any code sample to view its full details. Users with Contributor rights can edit existing code samples. Click on the code sample in the list to open the details modal. Modify the fields directly within the modal. Click “Update” to save your changes.
You can also mark code samples as favorites to make them easier to find later.
Using code samples¶
Once created, code samples to which you have access are available in DSS code creation flows alongside the built-in starters provided by Dataiku. Users can keep personal drafts and reusable starters in My Assets, then publish them to shared collections for broader reuse across teams. You can access and use any code sample stored in a collection where you hold at least Reader rights.