<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure D in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/41169#M27306</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/50693"&gt;@rubenesanchez&lt;/a&gt;&amp;nbsp; - Did you find a solution to your problem? I have the same question.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2023 13:46:31 GMT</pubDate>
    <dc:creator>Manjula_Ganesap</dc:creator>
    <dc:date>2023-08-23T13:46:31Z</dc:date>
    <item>
      <title>How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure Data Factory using REST API</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5802#M2104</link>
      <description>&lt;P&gt;I want to  pass some context information to the delta live tables pipeline when calling from Azure Data Factory. I know the body of the API call supports Full Refresh parameter but I wonder if I can add my own custom parameters and how this can be retrieved dynamically from the running notebook attached to pipeline&lt;/P&gt;&lt;P&gt;Any help appreciated &lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2023 15:33:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5802#M2104</guid>
      <dc:creator>rubenesanchez</dc:creator>
      <dc:date>2023-04-15T15:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure Data Factory using REST API</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5803#M2105</link>
      <description>&lt;P&gt;@Ruben Sanchez​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you can pass custom parameters to a Delta Live Table pipeline when calling it from Azure Data Factory using the REST API. One way to achieve this is by adding the custom parameters to the body of the API call as a JSON object. You can then retrieve these custom parameters dynamically from the running notebook attached to the pipeline.&lt;/P&gt;&lt;P&gt;Here is an example of how you can pass custom parameters to a Delta Live Table pipeline using the REST API:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In your ADF pipeline, add an HTTP activity to call the REST API endpoint for the Delta Live Table pipeline. In the body of the API call, include a JSON object with your custom parameters, like so:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE&gt;{
  "fullRefresh": true,
  "customParameter1": "value1",
  "customParameter2": "value2"
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2) In your Delta Live Table pipeline, retrieve the custom parameters from the body of the API call using the dbutils.widgets.get method. This method retrieves the value of a widget parameter that was passed to the notebook, which in this case is the custom parameters object.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import json
&amp;nbsp;
# Retrieve the custom parameters from the notebook widgets
custom_params_json = dbutils.widgets.get("custom_params")
custom_params = json.loads(custom_params_json)
&amp;nbsp;
# Retrieve the values of the custom parameters
custom_parameter1 = custom_params.get("customParameter1")
custom_parameter2 = custom_params.get("customParameter2")
&amp;nbsp;
# Use the custom parameters in your pipeline logic
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In this example, we first retrieve the custom parameters object from the notebook widget using the &lt;/P&gt;&lt;P&gt;dbutils.widgets.get method. We then parse the JSON string into a Python dictionary using the &lt;/P&gt;&lt;P&gt;json.loads method. Finally, we retrieve the values of the custom parameters using the get method on the dictionary, and use them in our pipeline logic.&lt;/P&gt;&lt;P&gt;Note that the custom parameter keys should be unique and not conflict with any reserved keywords used by the Delta Live Table pipeline, such as "fullRefresh" in the example above.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any further questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Apr 2023 07:06:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5803#M2105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-16T07:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure Data Factory using REST API</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5804#M2106</link>
      <description>&lt;P&gt;Hi @Ruben Sanchez​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting your question in our community! We are happy to assist you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 09:20:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5804#M2106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-17T09:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure Data Factory using REST API</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5805#M2107</link>
      <description>&lt;P&gt;Suteja&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for you response&lt;/P&gt;&lt;P&gt;Sorry I was only now that was able to test the solution. &lt;/P&gt;&lt;P&gt;I tried the code you supplied in my Delta Live Table notebook but got an error&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import dlt&lt;/P&gt;&lt;P&gt;from pyspark.sql.functions import *&lt;/P&gt;&lt;P&gt;from pyspark.sql.types import *&lt;/P&gt;&lt;P&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;import json&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;custom_params_json = dbutils.widgets.get("custom_params")&lt;/P&gt;&lt;P&gt;custom_params = json.loads(custom_params_json)&lt;/P&gt;&lt;P&gt;runid = custom_params.get("ADFrunid")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Py4JJavaError: An error occurred while calling o374.getArgument. : com.databricks.dbutils_v1.InputWidgetNotDefined: No input widget named custom_params is defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I add the widget declaration the code runs without error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dbutils.widgets.text("custom_params", """{"ADFrunid":"none"}""")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the notebook does not get the value passed and only resolves the default value&lt;/P&gt;&lt;P&gt;This is the code for the invocation from Azure Data Factory to the API (some key values suppressed for security reasons)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"url": &lt;A href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fadb-xxxxxx.azuredatabricks.net%2Fapi%2F2.0%2Fpipelines%2Fa8996a9d-a5f2-48ef-ada0-0ba98da037e7%2Fupdates&amp;amp;data=05%7C01%7C%7C4cc8d34334d54c3b505f08db54d2392f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638197034117052453%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=KPvj86HNdb5vEUxYeEFVCQBGYmdJ%2FoI3EUFj1Emz1KM%3D&amp;amp;reserved=0" alt="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fadb-xxxxxx.azuredatabricks.net%2Fapi%2F2.0%2Fpipelines%2Fa8996a9d-a5f2-48ef-ada0-0ba98da037e7%2Fupdates&amp;amp;data=05%7C01%7C%7C4cc8d34334d54c3b505f08db54d2392f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638197034117052453%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=KPvj86HNdb5vEUxYeEFVCQBGYmdJ%2FoI3EUFj1Emz1KM%3D&amp;amp;reserved=0" target="_blank"&gt;https://adb-XXXXXX.azuredatabricks.net/api/2.0/pipelines/a8996a9d-a5f2-48ef-ada0-0ba98da037e7/updates&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"method": "POST",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"headers": {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Authorization": "Bearer XXXXXXX"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"body": "{\n&amp;nbsp;\"fullRefresh\": false,\n&amp;nbsp;\"ADFrunid\": \"6b0a0e74-0f99-463c-9ff0-74fc17ea8958\"\n}"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ruben Sanchez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 00:03:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/5805#M2107</guid>
      <dc:creator>rubenesanchez</dc:creator>
      <dc:date>2023-05-15T00:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure D</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/41169#M27306</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/50693"&gt;@rubenesanchez&lt;/a&gt;&amp;nbsp; - Did you find a solution to your problem? I have the same question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:46:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/41169#M27306</guid>
      <dc:creator>Manjula_Ganesap</dc:creator>
      <dc:date>2023-08-23T13:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure D</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/84287#M37176</link>
      <description>&lt;P&gt;&lt;A href="https://community.databricks.com/t5/user/viewprofilepage/user-id/50693" target="_blank"&gt;@rubenesanchez&lt;/A&gt;&amp;nbsp;. I am also not able to fetch the details passed from ADF to DLT notebook. Were you able to resolve?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 08:39:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/84287#M37176</guid>
      <dc:creator>Vamshikrishna_r</dc:creator>
      <dc:date>2024-08-27T08:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How dynamically pass a string parameter to a Delta Live Table Pipeline when calling from Azure D</title>
      <link>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/96055#M39204</link>
      <description>&lt;P&gt;In case this helps anyone, I only could use the refresh_selection parameter setting it to [] by default. Then, in the notebook, I derived the custom parameter values from the refresh_selection value.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 01:20:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-dynamically-pass-a-string-parameter-to-a-delta-live-table/m-p/96055#M39204</guid>
      <dc:creator>BLM</dc:creator>
      <dc:date>2024-10-25T01:20:15Z</dc:date>
    </item>
  </channel>
</rss>

