How to use bundle substitutions in %pip install for Lakeflow Declarative Pipelines

ChrisLawford_n1
Contributor II

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