<?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 Can't pass dynamic parameters to non-notebook Python job (spark_python_task) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97734#M39527</link>
    <description>&lt;P&gt;I need to access the date of a given job running as a non-notebook Python job (spark_python_task). I want to pass a value from the cli when running it and being available to access the value in the script&lt;/P&gt;&lt;P&gt;I tried the approaches in the attached image when running&amp;nbsp;&lt;/P&gt;&lt;P&gt;bundle run my_job --params run_date=20240101&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2024 09:59:37 GMT</pubDate>
    <dc:creator>zed</dc:creator>
    <dc:date>2024-11-05T09:59:37Z</dc:date>
    <item>
      <title>Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97734#M39527</link>
      <description>&lt;P&gt;I need to access the date of a given job running as a non-notebook Python job (spark_python_task). I want to pass a value from the cli when running it and being available to access the value in the script&lt;/P&gt;&lt;P&gt;I tried the approaches in the attached image when running&amp;nbsp;&lt;/P&gt;&lt;P&gt;bundle run my_job --params run_date=20240101&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 09:59:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97734#M39527</guid>
      <dc:creator>zed</dc:creator>
      <dc:date>2024-11-05T09:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97753#M39531</link>
      <description>&lt;P&gt;Job parameters are automatically pushed down as key-value parameters to all tasks that accept key-value parameters, which include the following task types:&lt;/P&gt;
&lt;UL class="simple"&gt;
&lt;LI&gt;
&lt;P&gt;Notebook&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Python wheel (only when configured with keyword arguments)&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;SQL query, legacy dashboard, or file&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Run Job&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 05 Nov 2024 13:48:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97753#M39531</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-05T13:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97784#M39543</link>
      <description>&lt;P&gt;Hi, thank you for your response. I have a few follow-up questions to clarify best practices when it comes to passing parameters with Python files:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If I want to pass parameters, should I avoid using spark_python_task for Python scripts?&lt;/LI&gt;&lt;LI&gt;In the context of using Databricks Asset Bundles, is it generally discouraged to submit Databricks jobs using Python files (vs. notebooks)?&lt;/LI&gt;&lt;LI&gt;I was able to pass parameters with --python-params like --run_date 20240101 and then load them using argument parser. Is it accurate to say that spark_python_task does not support key-value parameter passing, and if so, what would you recommend if I want to maintain my project in Python files rather than notebooks while being able to pass parameters?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you for your help with this!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 15:48:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97784#M39543</guid>
      <dc:creator>zed</dc:creator>
      <dc:date>2024-11-05T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97795#M39552</link>
      <description>&lt;P&gt;I come with 1 more question.&amp;nbsp;To clarify, my previous questions were focused on jobs that are triggered manually, without scheduling.&lt;/P&gt;&lt;P&gt;For scheduled jobs—particularly those using Python script tasks—how can I configure the `job.yml` resource and the Python script to dynamically retrieve `{{job.start_time.iso_date}}` at runtime?&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 17:08:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97795#M39552</guid>
      <dc:creator>zed</dc:creator>
      <dc:date>2024-11-05T17:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97803#M39556</link>
      <description>&lt;P&gt;Can you confirm if this solution applies to you&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/retrieve-job-level-parameters-in-spark-python-task-not-notebooks/td-p/75324" target="_blank"&gt;https://community.databricks.com/t5/data-engineering/retrieve-job-level-parameters-in-spark-python-task-not-notebooks/td-p/75324&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 17:40:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97803#M39556</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-05T17:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can't pass dynamic parameters to non-notebook Python job (spark_python_task)</title>
      <link>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97804#M39557</link>
      <description>&lt;P&gt;So, I think if I change the spark_python_task to a notebook_task but I keep the file as python file instead of notebook is ok. Now I can use the data bricks&amp;nbsp;&lt;SPAN&gt;widgets easily and retrieve those parameters and I also put to version control python files instead of notebook&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 17:48:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/can-t-pass-dynamic-parameters-to-non-notebook-python-job-spark/m-p/97804#M39557</guid>
      <dc:creator>zed</dc:creator>
      <dc:date>2024-11-05T17:48:45Z</dc:date>
    </item>
  </channel>
</rss>

