- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2022 04:53 AM
I know the dbutils.widget.text to create a widget in a notebook. So for me the workflow
1. Having a notebook
2. Use dbutils.widget.text (or other type of widgets) once in a notebook cell to create a widget
3. Remove the cell containing dbutils.widget.text (because it's not usefull anymore)
4. Use dbutils.widget.get permanently in the notebook
Now I want to automate the following. I deploy a Jupyter notebook from a repo to a databricks workspace programmatically (using Azure devops). The deployment works fine using Databricks APIs, but only one thing is missing for me, the widget creation. Because manually creating the widget requires executing the cells with the widget.text call, how can I do that without having to run the cell manually, then remove it then come back to continue the deployment process.
- Labels:
-
Azure devops integration
-
Notebook
-
Widget
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2022 10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 03:27 AM
@Mehdi BEN ABDESSELEM , Did you try to run the job with that notebook with API?
https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunsSubmit -
Create and trigger a one-time run POST to https://<databricks-instance>/api/2.1/jobs/runs/submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2022 10:50 AM
Good to know, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2022 10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2022 10:51 AM
Good to know, thanks. I wonder if updating a notebook (overwriting the notebook with the API), will also remove the widget or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 01:50 PM
Hi @Mehdi BEN ABDESSELEM
What is the reason for removing the creation of the widget (e.g. dbutils.widget.text) in the notebook? You could leave it there with a proper default value and run the notebook if you need to. Also, if you do not want to see the code of the creation script, you could simply hide it.
Hope this helps, @Yves Mauron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 05:31 AM
The reason is I was concerned with the widget.text creation method would override the parameter sent through. But it seems it's not the case (even if I've seen some strange behavior with correctly spelt parameters not being recognized). Thank you indeed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 02:54 AM
Hi Fatma. There are enough information here. Most importantly, the widget creation instruction doesn't reinitialize the parameter which is passed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 01:26 AM
@Mehdi BEN ABDESSELEM ,
Steps for Creating a Basic Widget
Step 1: Create a New Project
To create a new project in Android Studio, please refer to How to Create/Start a New Project in Android Studio. We are implementing it for both Java and Kotlin languages.
Step 2: Add the App Widget to the Project
Right-Click on the app, move the cursor to new, find the “Widget” option at the end, and select it.
Specify the required properties for the widget, such as min. Width and height, config file, and preferred language proceed. Files are automatically generated.
Step 3: Install and Run the Code
Install and Run the code on Android Virtual Device (AVD) or a personal device.
Open the widget section of the phone, lookup for a widget with the Application name, select it, and bring it to the home screen.
Try changing the dimensions, and we are done!
This may help you,
Rachel Gomez

