Copilot commented on code in PR #2352:
URL: https://github.com/apache/sedona/pull/2352#discussion_r2353890039


##########
.github/workflows/r.yml:
##########
@@ -109,24 +112,34 @@ jobs:
           distribution: 'temurin'
           java-version: '11'
           cache: 'maven'
-      - name: Get OS name
-        id: os-name
-        run: |
-          # `os_name` will be like "Ubuntu-20.04.1-LTS"
-          OS_NAME=$(lsb_release -ds | sed 's/\s/-/g')
-          echo "os-name=$OS_NAME" >> $GITHUB_OUTPUT
-      - name: Cache Spark installations
-        if: runner.os != 'Windows'
-        uses: actions/cache@master
+      - uses: actions/setup-python@v5
         with:
-          path: ~/spark
-          key: apache.sedona-apache-spark-${{ steps.os-name.outputs.os-name 
}}-${{ env.SPARK_VERSION }}
+          python-version: '3.11'
+      - name: Install PySpark
+        run: |
+          pip3 install pyspark==${SPARK_VERSION}
+      - name: Download JAI libraries
+        run: |
+          PYSPARK_PATH=$(python3 -c "import pyspark; 
print(pyspark.__path__[0])")
+          wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_core/${JAI_CORE_VERSION}/jai_core-${JAI_CORE_VERSION}.jar
+          wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_codec/${JAI_CODEC_VERSION}/jai_codec-${JAI_CODEC_VERSION}.jar
+          wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_imageio/${JAI_IMAGEIO_VERSION}/jai_imageio-${JAI_IMAGEIO_VERSION}.jar

Review Comment:
   [nitpick] The wget retry configuration is duplicated across three lines. 
Consider extracting the common retry parameters to a variable to reduce 
duplication and make maintenance easier.
   ```suggestion
             WGET_RETRY_FLAGS="--retry-connrefused --waitretry=10 
--read-timeout=20 --timeout=15 --tries=5"
             wget $WGET_RETRY_FLAGS 
https://repo.osgeo.org/repository/release/javax/media/jai_core/${JAI_CORE_VERSION}/jai_core-${JAI_CORE_VERSION}.jar
             wget $WGET_RETRY_FLAGS 
https://repo.osgeo.org/repository/release/javax/media/jai_codec/${JAI_CODEC_VERSION}/jai_codec-${JAI_CODEC_VERSION}.jar
             wget $WGET_RETRY_FLAGS 
https://repo.osgeo.org/repository/release/javax/media/jai_imageio/${JAI_IMAGEIO_VERSION}/jai_imageio-${JAI_IMAGEIO_VERSION}.jar
   ```



##########
.github/workflows/r.yml:
##########
@@ -109,24 +112,34 @@ jobs:
           distribution: 'temurin'
           java-version: '11'
           cache: 'maven'
-      - name: Get OS name
-        id: os-name
-        run: |
-          # `os_name` will be like "Ubuntu-20.04.1-LTS"
-          OS_NAME=$(lsb_release -ds | sed 's/\s/-/g')
-          echo "os-name=$OS_NAME" >> $GITHUB_OUTPUT
-      - name: Cache Spark installations
-        if: runner.os != 'Windows'
-        uses: actions/cache@master
+      - uses: actions/setup-python@v5
         with:
-          path: ~/spark
-          key: apache.sedona-apache-spark-${{ steps.os-name.outputs.os-name 
}}-${{ env.SPARK_VERSION }}
+          python-version: '3.11'
+      - name: Install PySpark
+        run: |
+          pip3 install pyspark==${SPARK_VERSION}

Review Comment:
   The SPARK_VERSION environment variable is not defined in the workflow's env 
section. This will cause the pip install command to fail with an undefined 
variable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to