2323 required : false
2424 default : ' ubuntu-latest'
2525 type : string
26- # Options: DF_LIB, DF_LIB_NO_JIT, SPAWN, NORMAL
26+ # Options: DF_LIB, DF_LIB_NO_JIT, SPAWN, NORMAL, NARWHALS
2727 test-type :
2828 type : string
2929 description : The kind of tests to run e.g. spawn tests
3030 required : true
31+ bodo-version :
32+ type : string
33+ description : The version string of Bodo.
34+ required : true
3135
3236jobs :
3337 run :
4347 uses : ./.github/actions/build-source
4448 with :
4549 build-all : true
50+ env :
51+ SETUPTOOLS_SCM_PRETEND_VERSION : ${{ inputs.bodo-version }}
4652 - name : Load Hadoop from Cache
4753 if : runner.os != 'Windows'
4854 uses : actions/cache/restore@v4
6672 run : |
6773 pip install transformers
6874 pip install --no-deps 'git+https://github.com/apache/polaris.git@release/1.0.x#subdirectory=client/python'
75+ - name : Install Narwhals Test dependencies
76+ if : ${{ inputs.test-type == 'NARWHALS' }}
77+ run : |
78+ pip install hypothesis polars sqlframe ibis-framework pyarrow-hotfix
6979
7080 # Run Tests
7181 - name : Run Tests
@@ -81,40 +91,50 @@ jobs:
8191 fi
8292
8393 set +eo pipefail
84- # Bodo Tests: Coverage is collected
85- pytest -s -v -Wignore \
86- --cov-report= --cov=bodo \
87- --splits=${{ inputs.total-batches }} --group=${{ inputs.batch }} \
88- --store-durations --clean-durations \
89- --durations-path=buildscripts/github/test_dur_bodo.json \
90- -m "$PYTEST_MARKER" $PYTEST_IGNORE bodo/tests/
9194
92- # Save Exit Code for Later
93- python_test_exit_code=$?
95+ if [[ "${{ inputs.test-type }}" == "NARWHALS" ]]; then
96+ # Checkout narwhals fork
97+ git clone https://github.com/bodo-ai/narwhals.git
98+ cd narwhals
99+ python -c "import bodo; print('Detected Bodo version:', bodo.__version__)"
100+ pytest -s -v -Wignore -k bodo
101+ exit $?
102+ else
103+ # Bodo Tests: Coverage is collected
104+ pytest -s -v -Wignore \
105+ --cov-report= --cov=bodo \
106+ --splits=${{ inputs.total-batches }} --group=${{ inputs.batch }} \
107+ --store-durations --clean-durations \
108+ --durations-path=buildscripts/github/test_dur_bodo.json \
109+ -m "$PYTEST_MARKER" $PYTEST_IGNORE bodo/tests/
94110
95- # BodoSQL Tests
96- cd BodoSQL
97- pytest -s -v -Wignore \
98- --splits=${{ inputs.total-batches }} --group=${{ inputs.batch }} \
99- --store-durations --clean-durations \
100- --durations-path=../buildscripts/github/test_dur_bodosql.json \
101- -m "$PYTEST_MARKER" bodosql/tests/
102- sql_test_exit_code=$?
111+ # Save Exit Code for Later
112+ python_test_exit_code=$?
103113
104- # Pytest exits code 5 if no tests are run. Some markers are only in python or sql
105- # so we suppress this.
106- if [ "$python_test_exit_code" -eq 5 ]; then
107- python_test_exit_code=0
108- fi
109- if [ "$sql_test_exit_code" -eq 5 ]; then
110- sql_test_exit_code=0
111- fi
114+ # BodoSQL Tests
115+ cd BodoSQL
116+ pytest -s -v -Wignore \
117+ --splits=${{ inputs.total-batches }} --group=${{ inputs.batch }} \
118+ --store-durations --clean-durations \
119+ --durations-path=../buildscripts/github/test_dur_bodosql.json \
120+ -m "$PYTEST_MARKER" bodosql/tests/
121+ sql_test_exit_code=$?
112122
113- # Merge Exit Codes.
114- # If neither Bodo nor BodoSQL fails, the exit code will be 0
115- # If one fails, the exit code will be 1
116- # If both fail, the exit code will be 2
117- exit $((python_test_exit_code + sql_test_exit_code))
123+ # Pytest exits code 5 if no tests are run. Some markers are only in python or sql
124+ # so we suppress this.
125+ if [ "$python_test_exit_code" -eq 5 ]; then
126+ python_test_exit_code=0
127+ fi
128+ if [ "$sql_test_exit_code" -eq 5 ]; then
129+ sql_test_exit_code=0
130+ fi
131+
132+ # Merge Exit Codes.
133+ # If neither Bodo nor BodoSQL fails, the exit code will be 0
134+ # If one fails, the exit code will be 1
135+ # If both fail, the exit code will be 2
136+ exit $((python_test_exit_code + sql_test_exit_code))
137+ fi
118138 shell : bash
119139 env :
120140 BODO_TESTING_ONLY_RUN_1D_VAR : true
@@ -128,6 +148,7 @@ jobs:
128148 BODO_TEST_SPAWN_MODE : ${{ inputs.test-type == 'SPAWN' && '1' || '0' }}
129149 # Disabling the DataFrame library for spawn tests since some of the tests
130150 # create Pandas manager states for testing that are not fully functional.
151+ BODO_DATAFRAME_LIBRARY_WARN : ${{ inputs.test-type == 'NARWHALS' && '0' || '1' }}
131152 BODO_ENABLE_DATAFRAME_LIBRARY : ${{ inputs.test-type != 'SPAWN' && '1' || '0' }}
132153 BODO_ENABLE_TEST_DATAFRAME_LIBRARY : ${{ startsWith(inputs.test-type, 'DF_LIB') && '1' || '0' }}
133154 BODOSQL_PY4J_GATEWAY_PORT : " auto"
0 commit comments