<?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: VS Code - ipynb vs py execution - spark issue in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/vs-code-ipynb-vs-py-execution-spark-issue/m-p/124641#M3614</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/174408"&gt;@Sisi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think what's happening here is when you debug with option "&lt;STRONG&gt;Debug current file with Databricks Connect"&lt;/STRONG&gt;&amp;nbsp;then&amp;nbsp;VS Code is using Databricks extension, which automatically handles authentication and sets up proper configuration.&lt;/P&gt;&lt;P&gt;The regular Python debugger doesn't have access to the Databricks-specific authentication context that VS Code's extension provides.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jul 2025 14:11:59 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2025-07-09T14:11:59Z</dc:date>
    <item>
      <title>VS Code - ipynb vs py execution - spark issue</title>
      <link>https://community.databricks.com/t5/administration-architecture/vs-code-ipynb-vs-py-execution-spark-issue/m-p/124632#M3613</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Databricks Connect works inside VS Code notebook but the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;same code&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;fails in a standalone script with&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;ValueError: default auth: cannot configure default credentials&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I’m developing locally with **Databricks Connect 16.1.6** and VS Code.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Inside a Jupyter notebook(.venv) running one cell works fine:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
sys.path.append("../src")
from test_dab import main
main.get_taxis(spark).show(10)&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, when I am trying to debug the &lt;STRONG&gt;main&lt;/STRONG&gt; file (Python Debugger: Debug Python file) I am getting the error:&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;from pyspark.sql import SparkSession, DataFrame

def get_taxis(spark: SparkSession) -&amp;gt; DataFrame:
    return spark.read.table("samples.nyctaxi.trips")

def get_spark() -&amp;gt; SparkSession:
    try:
        from databricks.connect import DatabricksSession

        return DatabricksSession.builder.getOrCreate()
    except ImportError:
        return SparkSession.builder.getOrCreate()


def main():
    get_taxis(get_spark()).show(5)


if __name__ == "__main__":
    main()​&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;File "c:\[...]\main.py", line 15, in get_spark return DatabricksSession.builder.getOrCreate()&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;...&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;ValueError: default auth: cannot configure default credentials, please check &lt;A href="https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication" target="_blank" rel="noopener"&gt;https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication&lt;/A&gt; to configure credentials for your preferred authentication method.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I run main.py by "Debug current file with Databricks Connect" then it works.&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;Why is that?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 13:33:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/vs-code-ipynb-vs-py-execution-spark-issue/m-p/124632#M3613</guid>
      <dc:creator>Sisi</dc:creator>
      <dc:date>2025-07-09T13:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: VS Code - ipynb vs py execution - spark issue</title>
      <link>https://community.databricks.com/t5/administration-architecture/vs-code-ipynb-vs-py-execution-spark-issue/m-p/124641#M3614</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/174408"&gt;@Sisi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think what's happening here is when you debug with option "&lt;STRONG&gt;Debug current file with Databricks Connect"&lt;/STRONG&gt;&amp;nbsp;then&amp;nbsp;VS Code is using Databricks extension, which automatically handles authentication and sets up proper configuration.&lt;/P&gt;&lt;P&gt;The regular Python debugger doesn't have access to the Databricks-specific authentication context that VS Code's extension provides.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 14:11:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/vs-code-ipynb-vs-py-execution-spark-issue/m-p/124641#M3614</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-07-09T14:11:59Z</dc:date>
    </item>
  </channel>
</rss>

