imback82 commented on a change in pull request #30079:
URL: https://github.com/apache/spark/pull/30079#discussion_r510995012



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala
##########
@@ -74,8 +82,11 @@ private[connector] trait TestV2SessionCatalogBase[T <: 
Table] extends Delegating
   }
 
   def clearTables(): Unit = {
-    assert(!tables.isEmpty, "Tables were empty, maybe didn't use the session 
catalog code path?")
+    assert(
+      tableCreated.get,

Review comment:
       We have tests like the following:
   ```scala
     test("saveAsTable: Append mode should not fail if the table already exists 
" +
       "and a same-name temp view exist") {
       withTable("same_name") {
         withTempView("same_name") {
   ```
   Before, the table was not cleaned up correctly, so `!tables.isEmpty` was 
fine. But now that tables are cleaned up with this PR, we need a different way 
to check if this code path was executed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to