Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/17768
  
    Current status: I don't know how using
    
    ```scala
    val dirs = Array.empty[Int]
    dirs.headOption.getOrElse {
       throw new Exception("")
    }
    ```
    
    instead of 
    
    ```scala
    val dirs = Array.empty[Int]
    dirs(0)
    ```
    
    could make the tests failed (given the observations above).
    In the last commit, I gave a shot it with if-else as below:
    
    ```scala
    val dirs = Array.empty[Int]
    if (dirs.nonEmpty) {
      dirs(0)
    } else {
      throw new Exception("")
    }
    ```
    
    To make sure logically this should not make other tests flaky.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to