<?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: How can we import the exception &amp;quot;MetadataChangedException&amp;quot;? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-can-we-import-the-exception-quot-metadatachangedexception/m-p/111961#M44058</link>
    <description>&lt;P&gt;Hi! It depends on whether you're using Scala or Python.&lt;BR /&gt;&lt;BR /&gt;If you're using Scala, you should be able to import `io.delta.exceptions.MetadataChangedException`, which you can see defined here:&amp;nbsp;&lt;A href="https://github.com/delta-io/delta/blob/master/spark/src/main/scala/io/delta/exceptions/DeltaConcurrentExceptions.scala#L62" target="_blank"&gt;https://github.com/delta-io/delta/blob/master/spark/src/main/scala/io/delta/exceptions/DeltaConcurrentExceptions.scala#L62&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And for PySpark, I believe you might be able to catch `delta.exceptions.MetadataChangedException`, which is defined here:&amp;nbsp;&lt;A href="https://github.com/delta-io/delta/blob/master/python/delta/exceptions.py#L54" target="_blank"&gt;https://github.com/delta-io/delta/blob/master/python/delta/exceptions.py#L54&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Mar 2025 03:52:00 GMT</pubDate>
    <dc:creator>Nik_Vanderhoof</dc:creator>
    <dc:date>2025-03-07T03:52:00Z</dc:date>
    <item>
      <title>How can we import the exception "MetadataChangedException"?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-we-import-the-exception-quot-metadatachangedexception/m-p/110730#M43659</link>
      <description>&lt;P&gt;I regularly get&lt;BR /&gt;&lt;SPAN&gt;MetadataChangedException: [DELTA_METADATA_CHANGED] MetadataChangedException: The metadata of the Delta table has been changed by a concurrent update. Please try the operation again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;What is the recommended way to import this specific type of exception and handle it properly within a try-except clause?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 11:14:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-we-import-the-exception-quot-metadatachangedexception/m-p/110730#M43659</guid>
      <dc:creator>jkb7</dc:creator>
      <dc:date>2025-02-20T11:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can we import the exception "MetadataChangedException"?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-we-import-the-exception-quot-metadatachangedexception/m-p/111961#M44058</link>
      <description>&lt;P&gt;Hi! It depends on whether you're using Scala or Python.&lt;BR /&gt;&lt;BR /&gt;If you're using Scala, you should be able to import `io.delta.exceptions.MetadataChangedException`, which you can see defined here:&amp;nbsp;&lt;A href="https://github.com/delta-io/delta/blob/master/spark/src/main/scala/io/delta/exceptions/DeltaConcurrentExceptions.scala#L62" target="_blank"&gt;https://github.com/delta-io/delta/blob/master/spark/src/main/scala/io/delta/exceptions/DeltaConcurrentExceptions.scala#L62&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And for PySpark, I believe you might be able to catch `delta.exceptions.MetadataChangedException`, which is defined here:&amp;nbsp;&lt;A href="https://github.com/delta-io/delta/blob/master/python/delta/exceptions.py#L54" target="_blank"&gt;https://github.com/delta-io/delta/blob/master/python/delta/exceptions.py#L54&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 03:52:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-we-import-the-exception-quot-metadatachangedexception/m-p/111961#M44058</guid>
      <dc:creator>Nik_Vanderhoof</dc:creator>
      <dc:date>2025-03-07T03:52:00Z</dc:date>
    </item>
  </channel>
</rss>

