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

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a6080c5b4ee [SPARK-49347][R][FOLLOW-UP] Use dedicated environment 
variable for SparkR deprecation warning
2a6080c5b4ee is described below

commit 2a6080c5b4ee5e9f6e90dc2079456d47e79712c0
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Tue Sep 3 19:02:10 2024 +0900

    [SPARK-49347][R][FOLLOW-UP] Use dedicated environment variable for SparkR 
deprecation warning
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to have the dedicated environment variable called 
`SPARKR_SUPPRESS_DEPRECATION_WARNING` to skip SparkR deprecation warning.
    
    ### Why are the changes needed?
    
    In order to recover SparkR build on Windows 
(https://github.com/apache/spark/actions/workflows/build_sparkr_window.yml). 
Previously we did not set `SPARK_TESTING` before. 
https://github.com/apache/spark/pull/47881 set it and the build it broken. This 
PR works around it by having a dedicated environment variable.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, test-only.
    
    ### How was this patch tested?
    
    Manually tested.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #47972 from HyukjinKwon/SPARK-49347-followup2.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 .github/workflows/build_sparkr_window.yml | 2 +-
 R/pkg/R/sparkR.R                          | 2 +-
 R/run-tests.sh                            | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/build_sparkr_window.yml 
b/.github/workflows/build_sparkr_window.yml
index b6656351d431..ddaf60ad3e71 100644
--- a/.github/workflows/build_sparkr_window.yml
+++ b/.github/workflows/build_sparkr_window.yml
@@ -85,7 +85,7 @@ jobs:
       shell: cmd
       env:
         NOT_CRAN: true
-        SPARK_TESTING: 1
+        SPARKR_SUPPRESS_DEPRECATION_WARNING: 1
         # See SPARK-27848. Currently installing some dependent packages causes
         # "(converted from warning) unable to identify current timezone 'C':" 
for an unknown reason.
         # This environment variable works around to test SparkR against a 
higher version.
diff --git a/R/pkg/R/sparkR.R b/R/pkg/R/sparkR.R
index fc2ab8de1eca..29c05b0db7c2 100644
--- a/R/pkg/R/sparkR.R
+++ b/R/pkg/R/sparkR.R
@@ -404,7 +404,7 @@ sparkR.session <- function(
   enableHiveSupport = TRUE,
   ...) {
 
-  if (Sys.getenv("SPARK_TESTING") == "") {
+  if (Sys.getenv("SPARKR_SUPPRESS_DEPRECATION_WARNING") == "") {
     warning(
       "SparkR is deprecated from Apache Spark 4.0.0 and will be removed in a 
future version.")
   }
diff --git a/R/run-tests.sh b/R/run-tests.sh
index 90a60eda0387..3a90b44c2b65 100755
--- a/R/run-tests.sh
+++ b/R/run-tests.sh
@@ -30,9 +30,9 @@ if [[ $(echo $SPARK_AVRO_JAR_PATH | wc -l) -eq 1 ]]; then
 fi
 
 if [ -z "$SPARK_JARS" ]; then
-  SPARK_TESTING=1 NOT_CRAN=true $FWDIR/../bin/spark-submit 
--driver-java-options "-Dlog4j.configurationFile=file:$FWDIR/log4j2.properties" 
--conf spark.hadoop.fs.defaultFS="file:///" --conf 
spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" --conf 
spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
+  SPARKR_SUPPRESS_DEPRECATION_WARNING=1 SPARK_TESTING=1 NOT_CRAN=true 
$FWDIR/../bin/spark-submit --driver-java-options 
"-Dlog4j.configurationFile=file:$FWDIR/log4j2.properties" --conf 
spark.hadoop.fs.defaultFS="file:///" --conf 
spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" --conf 
spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
 else
-  SPARK_TESTING=1 NOT_CRAN=true $FWDIR/../bin/spark-submit --jars $SPARK_JARS 
--driver-java-options "-Dlog4j.configurationFile=file:$FWDIR/log4j2.properties" 
--conf spark.hadoop.fs.defaultFS="file:///" --conf 
spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" --conf 
spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
+  SPARKR_SUPPRESS_DEPRECATION_WARNING=1 SPARK_TESTING=1 NOT_CRAN=true 
$FWDIR/../bin/spark-submit --jars $SPARK_JARS --driver-java-options 
"-Dlog4j.configurationFile=file:$FWDIR/log4j2.properties" --conf 
spark.hadoop.fs.defaultFS="file:///" --conf 
spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" --conf 
spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true 
-Xss4M" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
 fi
 
 FAILED=$((PIPESTATUS[0]||$FAILED))


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

Reply via email to