07-02-2025 04:08 AM - edited 07-02-2025 04:19 AM
Hello,
When defining a Lakeflow Declarative Pipeline (DLT pipeline) I would like to allow the installation of a whl file to be dictated by the user running the pipeline. This will allow the notebook to have the pip installs at the top be agnostic of the developer deploying the bundle. W
Currently we have something like:
%pip install /Workspace/Users/a5ddafef-XXXX-XXXX-XXXX-a34e1c6acda0/.bundle/ADP/developer/artifacts/.internal/adp-0.1.0-py3-none-any.whl
What I would ideally like is:
%pip install ${workspace.root_path}/artifacts/.internal/adp-0.1.0-py3-none-any.whl
But you cant get the bundle substitutions inside the notebooks themselves from what I have read. I have tried to use dbutils.widgets to first get a passed in parameter and use that in the pip install.
This doesn't work in DLT pipelines though as you can't have any code above the %pip install line.
#lakeflowdeclarativepipelines #dlt #pip
07-02-2025 04:22 AM
Some considerations:
There is no way to use bundle substitutions or dynamic parameters inside DLT notebooks for the %pip install command at this time. All such substitutions are resolved at the bundle deployment (YAML) layer and do not propagate as runtime variables inside notebooks.
Mechanism | DLT %pip Supported | Bundle Variable Expansion | User/Env Agnostic |
---|---|---|---|
%pip install ${workspace.root_path}/... | Yes | No | No |
Hardcode absolute path in Shared/ location | Yes | Not needed | Partially |
dbutils.widgets/any-variable before %pip | No | N/A | N/A |
requirements.txt / environment spec (future) | Not yet | N/A | Not yet |
07-02-2025 04:22 AM
Some considerations:
There is no way to use bundle substitutions or dynamic parameters inside DLT notebooks for the %pip install command at this time. All such substitutions are resolved at the bundle deployment (YAML) layer and do not propagate as runtime variables inside notebooks.
Mechanism | DLT %pip Supported | Bundle Variable Expansion | User/Env Agnostic |
---|---|---|---|
%pip install ${workspace.root_path}/... | Yes | No | No |
Hardcode absolute path in Shared/ location | Yes | Not needed | Partially |
dbutils.widgets/any-variable before %pip | No | N/A | N/A |
requirements.txt / environment spec (future) | Not yet | N/A | Not yet |
07-02-2025 05:10 AM
Hey Lou,
Thanks for clarifying and for the swift response. Though nothing you said was news to me it was beneficial to have you confirm that what I am asking for is currently not possible and your alternative is currently what we are doing 🙂
Thanks,
Chris
07-02-2025 05:16 AM
Glad to help and feel free to "Accept as Solution" to help others in the same boat 🙂 Cheers, Lou.
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!
Sign Up Now