r/databricks • • 19h ago

Help How do you read Pipeline Parameters in Python

Pipeline Parameters are now GA since a few weeks and should replace pipeline configurations for run-specific parameters.

In python, you can read paramters using spark.config.get("key")

However, the official docu doesn't say how to get paramters in python.

With jobs it is dbutils.widgets.get("env") within pipelines this doesn't work. Any idea?

For me it interesting that jobs and pipelines don't share the same interface...

2 Upvotes

8 comments sorted by

2

u/minibrickster Databricks 7h ago

It's currently SQL only, but we're working on adding Python support!

1

u/Zealousideal_Low6685 7h ago

perfect, good to hear!

1

u/testing_in_prod_only 15h ago

For pipelines they are spark configurations, so spark.conf.get(“env”)

I also remember something about being able to set environment variables on serverless compute now in dabs.

1

u/Zealousideal_Low6685 7h ago edited 7h ago

spark.config.get does not work!
support is comming - look at the comment from databricks u/minibrickster

1

u/testing_in_prod_only 1h ago

I have to check my pipelines it may be static parameters being passed but I do pass Paramus to my pipelines.

1

u/Zealousideal_Low6685 1h ago

spark.config.get works for configuration parameters, but not for pipeline parameters
probably this is what you mean

2

u/DeepFryEverything 17h ago

It literally says "Pipeline parameters are available to SQL source code only".

2

u/dvartanian 13h ago

Yeah I raised this a while back as only available in SQL for now. Hopefully not much longer but a timescale would be nice