Skip to content

Commit 4ef5ec9

Browse files
committed
[SPARK-48424][INFRA] Make dev/is-changed.py to return true it it fails
### 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>
1 parent 541158f commit 4ef5ec9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dev/is-changed.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
#
1919

20+
import warnings
21+
import traceback
2022
import os
2123
import sys
2224
from argparse import ArgumentParser
@@ -82,4 +84,8 @@ def main():
8284

8385

8486
if __name__ == "__main__":
85-
main()
87+
try:
88+
main()
89+
except Exception:
90+
warnings.warn(f"Ignored exception:\n\n{traceback.format_exc()}")
91+
print("true")

0 commit comments

Comments
 (0)