<?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>question Re: Import custom files in dag-file Airflow jobs CDE in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412336#M253386</link>
    <description>&lt;P&gt;I create a resource as a file, because the python-env&amp;nbsp;&lt;SPAN&gt;resources are specifically for managing Python packages in requirements.txt, according to the documentation.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2025 22:03:59 GMT</pubDate>
    <dc:creator>ariajesus</dc:creator>
    <dc:date>2025-09-11T22:03:59Z</dc:date>
    <item>
      <title>Import custom files in dag-file Airflow jobs CDE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412325#M253378</link>
      <description>&lt;P&gt;I'm working with Airflow jobs in CDE. In my case, I have a resource that contains two files: one is the DAG file, and the other is a custom Python script that I want to import into the DAG.&lt;/P&gt;&lt;P&gt;According to the documentation, resources in Airflow are mounted under&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/app/mount/&amp;lt;PREFIX&amp;gt;. However, when a job is created or updated, the DAG is validated before the resources are actually mounted in that folder, which causes the import to fail.&lt;/P&gt;&lt;P&gt;If I encapsulate the import inside a PythonOperator, it works without issues, because at that point the resources are already available and the file can be found. The error I get during validation is always something like:&lt;/P&gt;&lt;P&gt;"failed: invalid request: Invalid DAG: dag_import: Traceback (most recent call last): File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 241, in _call_with_frames_removed File "/tmp/tmpfx_nrhlx/dag.py", line 6, in &amp;lt;module&amp;gt; from myModule import func ModuleNotFoundError: No module named 'myModule'"&lt;/P&gt;&lt;P&gt;I’ve tried not only creating the job with the import, but also creating an empty job first (so that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/app/mount/&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder is created), and then updating the DAG file — but the error remains the same.&lt;/P&gt;&lt;P&gt;Has anyone faced this issue and found a solution to make the import work from the beginning, without having to encapsulate it inside a function?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 06:17:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412325#M253378</guid>
      <dc:creator>ariajesus</dc:creator>
      <dc:date>2026-04-21T06:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Import custom files in dag-file Airflow jobs CDE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412334#M253385</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105158"&gt;@ariajesus&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Welcome to our community. Glad to see you here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How did you create the resource?&amp;nbsp;&lt;BR /&gt;As a File Resource or as a Python Environment?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vafs_0-1757626649759.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/46315i109CEEBF9AA2CF59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vafs_0-1757626649759.png" alt="vafs_0-1757626649759.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the steps how you can create it:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.cloudera.com/data-engineering/1.5.4/use-resources/topics/cde-create-python-virtual-env.html" target="_blank"&gt;https://docs.cloudera.com/data-engineering/1.5.4/use-resources/topics/cde-create-python-virtual-env.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 21:37:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412334#M253385</guid>
      <dc:creator>vafs</dc:creator>
      <dc:date>2025-09-11T21:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Import custom files in dag-file Airflow jobs CDE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412336#M253386</link>
      <description>&lt;P&gt;I create a resource as a file, because the python-env&amp;nbsp;&lt;SPAN&gt;resources are specifically for managing Python packages in requirements.txt, according to the documentation.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 22:03:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Import-custom-files-in-dag-file-Airflow-jobs-CDE/m-p/412336#M253386</guid>
      <dc:creator>ariajesus</dc:creator>
      <dc:date>2025-09-11T22:03:59Z</dc:date>
    </item>
  </channel>
</rss>

