<?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 Notebook parameter inaccessible in next code cell in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051281#M3158</link>
    <description>&lt;P&gt;I'm new to Data Engineering / Notebooks and am trying to follow a youtube video to setup a notebook for schema validation after data has been landed in Lakehouse files.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a parameter cell with a 'fileToTest' and a output_table_name. When I try to use the 'fileToTest' parameter outside of the parameter code cell it doesn't work and I get a "&lt;SPAN class=""&gt;NameError&lt;/SPAN&gt;&lt;SPAN&gt;: name 'fileToTest' is not defined" error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--- Updated with some additional findings&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I only have 3 code cells.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cell 1: (Parameters)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fileToTest = "Files/folder/file.csv"
output_table_name = 'raw_users'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 2&amp;nbsp; (attempting to install GreatExpectations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%pip install --q great_expectations

df = spark.read.format("csv").option("header","true").load(fileToTest)
display(df)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;BR /&gt;IF I comment out the pip install command the spark.read operation will work. Not sure what this means. Of course in my notebook that means cell 3 fails when it tries to import great_expectations.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 3 (attempting to create validations within Great Expectations Context&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import great_expectations as gx
gxContext = gx.get_context()
validator = gxContext.sources.pandas_default.read_csv(fileToTest)&lt;/LI-CODE&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;Either of the references above to 'fileToTest' fail with the NameError.&lt;/P&gt;&lt;P&gt;If I move this code to Cell 1 it works w/o issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;df = spark.read.format("csv").option("header","true").load(fileToTest)
display(df)&lt;/LI-CODE&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;For reference the original video is here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/wAayC-J9TsU?si=D25oMc7oZfpGFrxc" target="_blank" rel="noopener"&gt;https://youtu.be/wAayC-J9TsU?si=D25oMc7oZfpGFrxc&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jul 2024 01:49:59 GMT</pubDate>
    <dc:creator>jnickell</dc:creator>
    <dc:date>2024-07-20T01:49:59Z</dc:date>
    <item>
      <title>Notebook parameter inaccessible in next code cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051281#M3158</link>
      <description>&lt;P&gt;I'm new to Data Engineering / Notebooks and am trying to follow a youtube video to setup a notebook for schema validation after data has been landed in Lakehouse files.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a parameter cell with a 'fileToTest' and a output_table_name. When I try to use the 'fileToTest' parameter outside of the parameter code cell it doesn't work and I get a "&lt;SPAN class=""&gt;NameError&lt;/SPAN&gt;&lt;SPAN&gt;: name 'fileToTest' is not defined" error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--- Updated with some additional findings&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I only have 3 code cells.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cell 1: (Parameters)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fileToTest = "Files/folder/file.csv"
output_table_name = 'raw_users'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 2&amp;nbsp; (attempting to install GreatExpectations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%pip install --q great_expectations

df = spark.read.format("csv").option("header","true").load(fileToTest)
display(df)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;BR /&gt;IF I comment out the pip install command the spark.read operation will work. Not sure what this means. Of course in my notebook that means cell 3 fails when it tries to import great_expectations.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 3 (attempting to create validations within Great Expectations Context&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import great_expectations as gx
gxContext = gx.get_context()
validator = gxContext.sources.pandas_default.read_csv(fileToTest)&lt;/LI-CODE&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;Either of the references above to 'fileToTest' fail with the NameError.&lt;/P&gt;&lt;P&gt;If I move this code to Cell 1 it works w/o issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;df = spark.read.format("csv").option("header","true").load(fileToTest)
display(df)&lt;/LI-CODE&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;For reference the original video is here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/wAayC-J9TsU?si=D25oMc7oZfpGFrxc" target="_blank" rel="noopener"&gt;https://youtu.be/wAayC-J9TsU?si=D25oMc7oZfpGFrxc&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 01:49:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051281#M3158</guid>
      <dc:creator>jnickell</dc:creator>
      <dc:date>2024-07-20T01:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook parameter inaccessible in next code cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051585#M3166</link>
      <description>&lt;P&gt;Found the cause of my issue.&amp;nbsp; Learning newbie here.&lt;/P&gt;&lt;P&gt;spark.read works with the Files/.... path&lt;/P&gt;&lt;P&gt;great_Expectations / ?pandas?&amp;nbsp; requires /lakehouse/default/ to be prepended to the path&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 03:35:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051585#M3166</guid>
      <dc:creator>jnickell</dc:creator>
      <dc:date>2024-07-20T03:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook parameter inaccessible in next code cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051845#M3169</link>
      <description>&lt;P&gt;I don't have experience with parameter cell, however my&lt;SPAN&gt;&amp;nbsp;initial thought when you got the "NameError: name 'fileToTest' is not defined" was that you had not executed (run) Cell 1 before you tried to use the fileToTest variable in another cell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So therefore the 'fileToTest' variable didn't exist at that moment when you executed another cell.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 12:07:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-parameter-inaccessible-in-next-code-cell/m-p/4051845#M3169</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-07-20T12:07:58Z</dc:date>
    </item>
  </channel>
</rss>

