<?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 How to refer to repository directories in Workflows in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-refer-to-repository-directories-in-workflows/m-p/38772#M26753</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to refer to a configuration file which resides in a separate directory than the script. The paths and execution withing a notebook/python files work fine. When script is scheduled and uses code repository the directory names look obfuscated&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;[Databricks runtime]&lt;BR /&gt;&lt;SPAN&gt;repo dir: /Workspace/Repos/&amp;lt;user&amp;gt;/Python&lt;/SPAN&gt;&lt;BR /&gt;/config/config.yaml&lt;BR /&gt;/tests/test_script.py&lt;BR /&gt;&lt;BR /&gt;[Workflow]&lt;BR /&gt;&lt;SPAN&gt;repo dir: Workspace/Repos/.internal/af8a942fc5_commits&lt;BR /&gt;/c4e7042bee838df9e01242cc09cc81524cc07f24/config.yaml&lt;BR /&gt;/b01e96980f85e154fc22e20c225275216fefde80/test_script.py&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;How do I refer from within test_script.py and read config.yaml?&lt;BR /&gt;Note that directory name changes with each run...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2023 09:33:14 GMT</pubDate>
    <dc:creator>avesel</dc:creator>
    <dc:date>2023-07-31T09:33:14Z</dc:date>
    <item>
      <title>How to refer to repository directories in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-refer-to-repository-directories-in-workflows/m-p/38772#M26753</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to refer to a configuration file which resides in a separate directory than the script. The paths and execution withing a notebook/python files work fine. When script is scheduled and uses code repository the directory names look obfuscated&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;[Databricks runtime]&lt;BR /&gt;&lt;SPAN&gt;repo dir: /Workspace/Repos/&amp;lt;user&amp;gt;/Python&lt;/SPAN&gt;&lt;BR /&gt;/config/config.yaml&lt;BR /&gt;/tests/test_script.py&lt;BR /&gt;&lt;BR /&gt;[Workflow]&lt;BR /&gt;&lt;SPAN&gt;repo dir: Workspace/Repos/.internal/af8a942fc5_commits&lt;BR /&gt;/c4e7042bee838df9e01242cc09cc81524cc07f24/config.yaml&lt;BR /&gt;/b01e96980f85e154fc22e20c225275216fefde80/test_script.py&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;How do I refer from within test_script.py and read config.yaml?&lt;BR /&gt;Note that directory name changes with each run...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 09:33:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-refer-to-repository-directories-in-workflows/m-p/38772#M26753</guid>
      <dc:creator>avesel</dc:creator>
      <dc:date>2023-07-31T09:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to refer to repository directories in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-refer-to-repository-directories-in-workflows/m-p/106701#M42558</link>
      <description>&lt;P&gt;can you try with relative path?&lt;/P&gt;&lt;P&gt;like you get your current path within test_script.py with command like:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;cur_path &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; os.&lt;/SPAN&gt;&lt;SPAN&gt;getcwd&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then get the path to config.yaml with a relative path like:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;config_path &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; os.path.&lt;/SPAN&gt;&lt;SPAN&gt;abspath&lt;/SPAN&gt;&lt;SPAN&gt;(os.path.&lt;/SPAN&gt;&lt;SPAN&gt;join&lt;/SPAN&gt;&lt;SPAN&gt;(cur_path, &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"../config/config.yaml&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Jan 2025 18:42:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-refer-to-repository-directories-in-workflows/m-p/106701#M42558</guid>
      <dc:creator>lauraxyz</dc:creator>
      <dc:date>2025-01-22T18:42:52Z</dc:date>
    </item>
  </channel>
</rss>

