[DEMO] Test skip unsupported prerelease packages - #18034
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces workarounds in the CI script (ci/run_single_test.sh) to handle packages with heavy C/Rust dependencies that fail to install on pre-release Python versions (such as Python 3.15). However, the review feedback points out that these workarounds are currently applied unconditionally. This would cause packages to be skipped or installation failures to be silently ignored even on stable Python versions. The reviewer has provided actionable code suggestions to restrict these checks specifically to Python 3.15 environments.
| UNSUPPORTED_PRE_RELEASE_PACKAGES=( | ||
| "bigframes" | ||
| "pandas-gbq" | ||
| "google-cloud-documentai-toolbox" | ||
| "db-dtypes" | ||
| "bigquery-magics" | ||
| ) | ||
| for unsupported in "${UNSUPPORTED_PRE_RELEASE_PACKAGES[@]}"; do | ||
| if [ "${PACKAGE_NAME}" = "${unsupported}" ]; then | ||
| echo "WARNING: Skipping import_profile for ${PACKAGE_NAME}: package has heavy C/Rust dependencies not yet supported on pre-release Python ${PY_VERSION}." | ||
| exit 0 | ||
| fi | ||
| done |
There was a problem hiding this comment.
The check for unsupported pre-release packages is executed unconditionally for all Python versions. This will cause import_profile to be skipped for these packages even on stable Python versions (e.g., 3.10, 3.11, 3.12) where they should be fully tested. Wrap this check in a condition that restricts it to pre-release Python versions (e.g., checking if ${PY_VERSION} starts with 3.15).
| UNSUPPORTED_PRE_RELEASE_PACKAGES=( | |
| "bigframes" | |
| "pandas-gbq" | |
| "google-cloud-documentai-toolbox" | |
| "db-dtypes" | |
| "bigquery-magics" | |
| ) | |
| for unsupported in "${UNSUPPORTED_PRE_RELEASE_PACKAGES[@]}"; do | |
| if [ "${PACKAGE_NAME}" = "${unsupported}" ]; then | |
| echo "WARNING: Skipping import_profile for ${PACKAGE_NAME}: package has heavy C/Rust dependencies not yet supported on pre-release Python ${PY_VERSION}." | |
| exit 0 | |
| fi | |
| done | |
| if [[ "${PY_VERSION}" == "3.15"* ]]; then | |
| UNSUPPORTED_PRE_RELEASE_PACKAGES=( | |
| "bigframes" | |
| "pandas-gbq" | |
| "google-cloud-documentai-toolbox" | |
| "db-dtypes" | |
| "bigquery-magics" | |
| ) | |
| for unsupported in "${UNSUPPORTED_PRE_RELEASE_PACKAGES[@]}"; do | |
| if [ "${PACKAGE_NAME}" = "${unsupported}" ]; then | |
| echo "WARNING: Skipping import_profile for ${PACKAGE_NAME}: package has heavy C/Rust dependencies not yet supported on pre-release Python ${PY_VERSION}." | |
| exit 0 | |
| fi | |
| done | |
| fi |
| if ! pip install -e . ; then | ||
| echo "WARNING: Could not install dependencies for ${PACKAGE_NAME} on Python ${PY_VERSION} (missing pre-built binary wheels for pre-release Python). Skipping import_profile." | ||
| retval=0 | ||
| else | ||
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 | ||
| if [ -f "${BASELINE_CSV}" ]; then | ||
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100 | ||
| else | ||
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 | ||
| fi | ||
| retval=$? | ||
| fi |
There was a problem hiding this comment.
If pip install -e . fails on a stable Python version, the script will silently ignore the failure and return success (retval=0). This fallback should only be applied on pre-release Python versions (e.g., 3.15) where missing binary wheels are expected. On stable Python versions, installation failures should result in a non-zero exit code to correctly fail the CI build.
| if ! pip install -e . ; then | |
| echo "WARNING: Could not install dependencies for ${PACKAGE_NAME} on Python ${PY_VERSION} (missing pre-built binary wheels for pre-release Python). Skipping import_profile." | |
| retval=0 | |
| else | |
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 | |
| if [ -f "${BASELINE_CSV}" ]; then | |
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100 | |
| else | |
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 | |
| fi | |
| retval=$? | |
| fi | |
| if ! pip install -e . ; then | |
| if [[ "${PY_VERSION}" == "3.15"* ]]; then | |
| echo "WARNING: Could not install dependencies for ${PACKAGE_NAME} on Python ${PY_VERSION} (missing pre-built binary wheels for pre-release Python). Skipping import_profile." | |
| retval=0 | |
| else | |
| echo "ERROR: Failed to install dependencies for ${PACKAGE_NAME} on Python ${PY_VERSION}." | |
| retval=1 | |
| fi | |
| else | |
| if [ -f "${BASELINE_CSV}" ]; then | |
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100 | |
| else | |
| python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 | |
| fi | |
| retval=$? | |
| fi |
No description provided.