cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Access workflow settings from within a notebook.

159312
New Contributor III

I have a notebook used for a dlt pipeline. The pipeline should perform an extra task if the pipeline is run as a full refresh. Right now, I have to set an extra configuration parameter when I run a full refresh. Is there a way to programmatically access whether the current run is a full_refresh or a regular run?

4 REPLIES 4

Debayan
Databricks Employee
Databricks Employee

@Ben Bogart​ The create_update event log table can be queried to know if it is a full_refresh or a regular run.

Alternatively, in addition,

2.0/pipelines/{pipeline_id}/updates

 The above API call should return the update ID.

You can then get update details for that update_id by using the below API:

2.0/pipelines/{pipeline_id}/updates/{update_id}

The JSON response body should have a field 'full_refresh: true|false'.

159312
New Contributor III

@Debayan Mukherjee​ I would like to automate this from within a notebook that is a part of multiple pipelines. Both solutions require knowing the `pipeline_id`. How can I access the pipeline id from within a pipeline run?

Reference Links for future readers:

Documentation for querying the log

pipeline id for the run can be found using:

spark.conf.get("pipelines.id")

Vidula
Honored Contributor

Hi @Ben Bogart​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group