<?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: %run command: Pass Notebook path as a parameter in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103270#M41390</link>
    <description>&lt;P&gt;These global temp views are available to all workloads running against a compute resource, but they do not persist beyond the lifecycle of the cluster or the session that created them.&lt;BR /&gt;&lt;BR /&gt;You can refer to&amp;nbsp;&lt;A href="https://docs.databricks.com/en/views/index.html#temporary-views" target="_blank"&gt;https://docs.databricks.com/en/views/index.html#temporary-views&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2024 02:16:49 GMT</pubDate>
    <dc:creator>Walter_C</dc:creator>
    <dc:date>2024-12-27T02:16:49Z</dc:date>
    <item>
      <title>%run command: Pass Notebook path as a parameter</title>
      <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103254#M41383</link>
      <description>&lt;P&gt;Hi team!&lt;/P&gt;&lt;P&gt;I have a Notebook (notebook A) in workspace and I'd like to execute it with %run command from another Notebook (notebook B).&amp;nbsp; It works perfect with command:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%run /workspace/path/to/notebook/A&lt;/LI-CODE&gt;&lt;P&gt;Now, i want to specify above path in a variable, and pass that variable into the %run command, something like this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%run $notebook_path&lt;/LI-CODE&gt;&lt;P&gt;where notebook_path is defined as notebook_path=/workspace/path/to/notebook/A.&lt;/P&gt;&lt;P&gt;However, i keep getting "&lt;SPAN&gt;Notebook not found" error, i also tried %run {notebook_path} which didn't work. How can i make this work?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 18:45:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103254#M41383</guid>
      <dc:creator>lauraxyz</dc:creator>
      <dc:date>2024-12-26T18:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: %run command: Pass Notebook path as a parameter</title>
      <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103256#M41385</link>
      <description>&lt;P&gt;What if you try:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV class="gb5fhw2"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-python _1t7bu9hb hljs language-python gb5fhw3"&gt;&lt;SPAN class="hljs-comment"&gt;# Define the notebook path&lt;/SPAN&gt;
notebook_path = &lt;SPAN class="hljs-string"&gt;"/workspace/path/to/notebook/A"&lt;/SPAN&gt;

&lt;SPAN class="hljs-comment"&gt;# Run the notebook using dbutils.notebook.run&lt;/SPAN&gt;
dbutils.notebook.run(notebook_path, &lt;SPAN class="hljs-number"&gt;60&lt;/SPAN&gt;)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;In this example, &lt;CODE&gt;60&lt;/CODE&gt; is the timeout in seconds. You can adjust this value as needed. The &lt;CODE&gt;dbutils.notebook.run&lt;/CODE&gt; method allows you to pass parameters and handle return values, which provides more flexibility compared to the &lt;CODE&gt;%run&lt;/CODE&gt; command&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 19:58:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103256#M41385</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-26T19:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: %run command: Pass Notebook path as a parameter</title>
      <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103257#M41386</link>
      <description>&lt;P&gt;&amp;nbsp;%run commands is preferred in my use case because I need to access the dataframe generated in notebook A from notebook B.&amp;nbsp; with %run, that's very straightforward, since A is executed inline with the same context.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using dbutils.notebook.run, notebook A will be executed in a different namespace, is there an efficient way to get the dataframe generated in A?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 20:30:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103257#M41386</guid>
      <dc:creator>lauraxyz</dc:creator>
      <dc:date>2024-12-26T20:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: %run command: Pass Notebook path as a parameter</title>
      <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103269#M41389</link>
      <description>&lt;P&gt;Thanks I think dbutils.notebook.run will work well in my use case.&lt;/P&gt;&lt;P&gt;I was following &lt;A href="https://docs.databricks.com/en/notebooks/notebook-workflows.html#pass-structured-data" target="_self"&gt;this&lt;/A&gt;, and was able to store the results in a temp view in callee notebook (A), and access results from the caller notebook (B).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a quick question: how often will the temp views stored in "globalTempDatabase" be cleared, is that something we need to configure? Just want to make sure that it'll not affect our job performance by getting too much temp data stored.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 23:30:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103269#M41389</guid>
      <dc:creator>lauraxyz</dc:creator>
      <dc:date>2024-12-26T23:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: %run command: Pass Notebook path as a parameter</title>
      <link>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103270#M41390</link>
      <description>&lt;P&gt;These global temp views are available to all workloads running against a compute resource, but they do not persist beyond the lifecycle of the cluster or the session that created them.&lt;BR /&gt;&lt;BR /&gt;You can refer to&amp;nbsp;&lt;A href="https://docs.databricks.com/en/views/index.html#temporary-views" target="_blank"&gt;https://docs.databricks.com/en/views/index.html#temporary-views&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 02:16:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/run-command-pass-notebook-path-as-a-parameter/m-p/103270#M41390</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-12-27T02:16:49Z</dc:date>
    </item>
  </channel>
</rss>

