<?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: Is it possible to passthrough job's parameters to variable? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15405#M9736</link>
    <description>&lt;P&gt;Oh, I see what you are looking for. Yes- totally possible. Here would be your primary notebook code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;all_args = dbutils.notebook.entry_point.getCurrentBindings()
 
print(all_args)
&amp;nbsp;
for arg in all_args:
  print(arg)
 
nb1 = dbutils.notebook.run('./notebooks_sec_1', 0, all_args)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Sep 2021 20:37:42 GMT</pubDate>
    <dc:creator>Dan_Z</dc:creator>
    <dc:date>2021-09-14T20:37:42Z</dc:date>
    <item>
      <title>Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15402#M9733</link>
      <description>&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;I tried to run notebook_primary as a job with same parameters' map. This notebook is orchestrator for notebooks_sec_1, notebooks_sec_2, and notebooks_sec_3 and next. I run them by dbutils.notebook.run(path, timeout, arguments) function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how to get in notebook_primary all input parameters become from Job's configuration and pass them to notebooks_sec_... like i.e.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;arg = some_magic_function_gathering_all_actual_input_params()
&amp;nbsp;
#
# some iteration on arg
#
&amp;nbsp;
nb1 = dbutils.notebook.run('./notebooks_sec_1', 0, arg)
&amp;nbsp;
nb2= dbutils.notebook.run('./notebooks_sec_2', 0, arg)
&amp;nbsp;
nb3 = dbutils.notebook.run('./notebooks_sec_3', 0, arg)
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can't iterate through input params, I can get value when I know name of the parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 15:19:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15402#M9733</guid>
      <dc:creator>del1000</dc:creator>
      <dc:date>2021-09-14T15:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15403#M9734</link>
      <description>&lt;P&gt;Very possible. You just use dbutils.widgets.get().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance I set up a job with the following param:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
  "foo": "bar"
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The primary notebook:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;the_arg = dbutils.widgets.get("foo")
&amp;nbsp;
print(the_arg)
&amp;nbsp;
nb1 = dbutils.notebook.run('./notebooks_sec_1', 0, {"foo" : the_arg})&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;notebooks_sec_1:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;the_arg = dbutils.widgets.get("foo")
&amp;nbsp;
print(the_arg)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, when I ran it, both printed: "bar".&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 18:12:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15403#M9734</guid>
      <dc:creator>Dan_Z</dc:creator>
      <dc:date>2021-09-14T18:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15404#M9735</link>
      <description>&lt;P&gt;Sorry but it is not the answer for my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In notebook_primary, I don't know all names of node of arguments. I'd like to iterate arguments, do some change within it and send to process to each notebook_sec_* at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is: is the notebook able to know arguments which has been used to run it? Precisely, is it possible to write a below code?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;for arg_key in arguments.keys():
 print(arg_key)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:42:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15404#M9735</guid>
      <dc:creator>del1000</dc:creator>
      <dc:date>2021-09-14T19:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15405#M9736</link>
      <description>&lt;P&gt;Oh, I see what you are looking for. Yes- totally possible. Here would be your primary notebook code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;all_args = dbutils.notebook.entry_point.getCurrentBindings()
 
print(all_args)
&amp;nbsp;
for arg in all_args:
  print(arg)
 
nb1 = dbutils.notebook.run('./notebooks_sec_1', 0, all_args)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 20:37:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15405#M9736</guid>
      <dc:creator>Dan_Z</dc:creator>
      <dc:date>2021-09-14T20:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15406#M9737</link>
      <description>&lt;P&gt;Thank you, Dan. That is exactly what I wanted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; By the way, where are these property and method of dbutils described? I can't find any references to them.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 09:03:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15406#M9737</guid>
      <dc:creator>del1000</dc:creator>
      <dc:date>2021-09-15T09:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15407#M9738</link>
      <description>&lt;P&gt;We have exactly the same requirement but we were looking for a similar possibility using Scala code. We were not able to find any function close to getCurrentBindings() in scala.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 06:51:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15407#M9738</guid>
      <dc:creator>673602</dc:creator>
      <dc:date>2021-10-01T06:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15408#M9739</link>
      <description>&lt;P&gt;@Balbir Singh​&amp;nbsp;, I'm newbie in Databricks but the manual says you can use a python cell and transfer variables to scala's cell by temp tables.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/notebooks/notebook-workflows.html#pass-structured-data" target="test_blank"&gt;https://docs.databricks.com/notebooks/notebook-workflows.html#pass-structured-data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2021 18:56:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/15408#M9739</guid>
      <dc:creator>del1000</dc:creator>
      <dc:date>2021-10-03T18:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/90634#M37969</link>
      <description>&lt;P&gt;d&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 23:32:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/90634#M37969</guid>
      <dc:creator>nnalla</dc:creator>
      <dc:date>2024-09-16T23:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to passthrough job's parameters to variable?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/90635#M37970</link>
      <description>&lt;P&gt;I am using getCurrentBindings(), but it returns an empty dictionary even though I passed parameters. I am running it in a scheduled workflow job&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 23:36:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-passthrough-job-s-parameters-to-variable/m-p/90635#M37970</guid>
      <dc:creator>nnalla</dc:creator>
      <dc:date>2024-09-16T23:36:57Z</dc:date>
    </item>
  </channel>
</rss>

