This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 2da30ad0658 [SPARK-41863][INFRA][PYTHON][TESTS] Skip `flake8` tests if 
the command is not available
2da30ad0658 is described below

commit 2da30ad0658406462ede656ad368f890e7051a5e
Author: Dongjoon Hyun <dongj...@apache.org>
AuthorDate: Tue Jan 3 15:01:43 2023 -0800

    [SPARK-41863][INFRA][PYTHON][TESTS] Skip `flake8` tests if the command is 
not available
    
    ### What changes were proposed in this pull request?
    
    This PR aims to skip `flake8` tests if the command is not available.
    
    ### Why are the changes needed?
    
    Linters are optional modules and we can be skip in some systems like `mypy`.
    ```
    $ dev/lint-python
    starting python compilation test...
    python compilation succeeded.
    
    The Python library providing 'black' module was not found. Skipping black 
checks for now.
    
    The flake8 command was not found. Skipping for now.
    The mypy command was not found. Skipping for now.
    
    all lint-python tests passed!
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manual tests.
    
    Closes #39372 from dongjoon-hyun/SPARK-41863.
    
    Authored-by: Dongjoon Hyun <dongj...@apache.org>
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
    (cherry picked from commit 1a5ef40a4d59b377b028b55ea3805caf5d55f28f)
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
---
 dev/lint-python | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dev/lint-python b/dev/lint-python
index f0ca8832be0..5505f4b1105 100755
--- a/dev/lint-python
+++ b/dev/lint-python
@@ -173,9 +173,8 @@ function flake8_test {
     local FLAKE8_STATUS=
 
     if ! hash "$FLAKE8_BUILD" 2> /dev/null; then
-        echo "The flake8 command was not found."
-        echo "flake8 checks failed."
-        exit 1
+        echo "The flake8 command was not found. Skipping for now."
+        return
     fi
 
     _FLAKE8_VERSION=($($FLAKE8_BUILD --version))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to