<?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 can I fix strange magic command behaviour in Databricks notebooks? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30404#M22042</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have encountered a strange issue when using magic commands on my Azure Databricks workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create a cell and type the magic command for a language which is not default in the notebook, the code is instead interpreted as the default notebook language.&lt;/P&gt;&lt;P&gt;Here you can see a notebook with python as the default language, with a sql magic command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="magic command manually typed"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1445iA8E0516033477AD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="magic command manually typed" alt="magic command manually typed" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="magic command manually typed 2"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1448i962064188875642F/image-size/large?v=v2&amp;amp;px=999" role="button" title="magic command manually typed 2" alt="magic command manually typed 2" /&gt;&lt;/span&gt;And here, the same notebook. But with python code written in the cell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1455i263697CF7915E285/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I create a cell at the end of the notebook (not in between existing cells). And then set the language to SQL using this button, the code will be correctly interpreted as SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue first arose this week on Monday the 26th of September. It has broken a lot of my existing notebooks which use "%sql".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried restarting my cluster, creating a new cluster, creating a new notebook, and changing my notebook default language. But none of these have fixed the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 12:16:25 GMT</pubDate>
    <dc:creator>jowziph</dc:creator>
    <dc:date>2022-09-28T12:16:25Z</dc:date>
    <item>
      <title>How can I fix strange magic command behaviour in Databricks notebooks?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30404#M22042</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have encountered a strange issue when using magic commands on my Azure Databricks workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create a cell and type the magic command for a language which is not default in the notebook, the code is instead interpreted as the default notebook language.&lt;/P&gt;&lt;P&gt;Here you can see a notebook with python as the default language, with a sql magic command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="magic command manually typed"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1445iA8E0516033477AD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="magic command manually typed" alt="magic command manually typed" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="magic command manually typed 2"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1448i962064188875642F/image-size/large?v=v2&amp;amp;px=999" role="button" title="magic command manually typed 2" alt="magic command manually typed 2" /&gt;&lt;/span&gt;And here, the same notebook. But with python code written in the cell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1455i263697CF7915E285/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I create a cell at the end of the notebook (not in between existing cells). And then set the language to SQL using this button, the code will be correctly interpreted as SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue first arose this week on Monday the 26th of September. It has broken a lot of my existing notebooks which use "%sql".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried restarting my cluster, creating a new cluster, creating a new notebook, and changing my notebook default language. But none of these have fixed the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 12:16:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30404#M22042</guid>
      <dc:creator>jowziph</dc:creator>
      <dc:date>2022-09-28T12:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I fix strange magic command behaviour in Databricks notebooks?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30406#M22044</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yeah this is happening&amp;nbsp;when magic command is used in between two cells of the default language. But this is not the only case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is happening when magic command is manually typed out (e.g. %sql or %scala in a python notebook). OR when magic command is selected from the language button and the cell is not a brand new cell at the bottom of the notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is making it difficult for me to develop multi language notebooks.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 14:40:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30406#M22044</guid>
      <dc:creator>jowziph</dc:creator>
      <dc:date>2022-09-28T14:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I fix strange magic command behaviour in Databricks notebooks?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30405#M22043</link>
      <description>&lt;P&gt;Hi, Is this happening when magic command is used in between two cells of the default language? &lt;/P&gt;&lt;P&gt;You can override the default language in a cell by clicking the language button and selecting a language from the dropdown menu. Alternately, you can use the language magic command&amp;nbsp;&lt;B&gt;%&amp;lt;language&amp;gt;&lt;/B&gt;&amp;nbsp;at the beginning of a cell. The supported magic commands are: %python , %r , %scala , and %sql .&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:30:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-fix-strange-magic-command-behaviour-in-databricks/m-p/30405#M22043</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2022-09-28T13:30:00Z</dc:date>
    </item>
  </channel>
</rss>

