Skip to content

Commit

Permalink
[SPARK-48424][INFRA] Make dev/is-changed.py to return true it it fails
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This PR proposes to make dev/is-changed.py to return true it it fails

### Why are the changes needed?

To make the test robust. GitHub Actions sometimes fail to set the hash for commit properly, e.g., https://github.com/apache/spark/actions/runs/9244026522/job/25435224163?pr=46747

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

Manually tested:

```bash
GITHUB_SHA=a29c9653f3d48d97875ae446d82896bdf0de61ca GITHUB_PREV_SHA=0000000000000000000000000000000000000000 ./dev/is-changed.py -m root
```

```bash
a=`GITHUB_SHA=a29c9653f3d48d97875ae446d82896bdf0de61ca GITHUB_PREV_SHA=0000000000000000000000000000000000000000 ./dev/is-changed.py -m root`
echo $a
```

```bash
GITHUB_SHA=a29c9653f3d48d97875ae446d82896bdf0de61ca GITHUB_PREV_SHA=3346afd4b250c3aead5a237666d4942018a463e0 ./dev/is-changed.py -m root
```

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #46749 from HyukjinKwon/SPARK-48424.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
HyukjinKwon committed May 27, 2024
1 parent 541158f commit 4ef5ec9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dev/is-changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# limitations under the License.
#

import warnings
import traceback
import os
import sys
from argparse import ArgumentParser
Expand Down Expand Up @@ -82,4 +84,8 @@ def main():


if __name__ == "__main__":
main()
try:
main()
except Exception:
warnings.warn(f"Ignored exception:\n\n{traceback.format_exc()}")
print("true")

0 comments on commit 4ef5ec9

Please sign in to comment.