Skip to content

Conversation

@amoeba
Copy link
Member

@amoeba amoeba commented Apr 9, 2025

Rationale for this change

This fixes our test-r-offline-maximal job which started failing because of a change in reticulate 1.41.0.

What changes are included in this PR?

Changed internals of our skip_on_python_older_than helper.

Are these changes tested?

Locally, need to test in CI before merging.

Are there any user-facing changes?

No.

@amoeba
Copy link
Member Author

amoeba commented Apr 9, 2025

@github-actions crossbow submit test-r-offline-maximal

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Revision: c76756e

Submitted crossbow builds: ursacomputing/crossbow @ actions-d817e71ea4

Task Status
test-r-offline-maximal GitHub Actions

@amoeba amoeba marked this pull request as draft April 10, 2025 00:37
@amoeba
Copy link
Member Author

amoeba commented Apr 10, 2025

Crossbow job passes, I see the test we expect to be skipped skips when checking Python version,

2025-04-09T23:48:59.5925641Z Start test: install_pyarrow
2025-04-09T23:48:59.5925766Z   'test-python.R:26:3' [skip] <-- this is `skip_on_python_older_than("3.9")`
2025-04-09T23:48:59.5925883Z End test: install_pyarrow

I'm going to exercise the new helper code by installing a newer Python version in the runner temporarily.

@amoeba
Copy link
Member Author

amoeba commented Apr 10, 2025

@github-actions crossbow submit test-r-offline-maximal

@github-actions
Copy link

Revision: c82635de9d908644f7476f20c5c752df9c13fdc8

Submitted crossbow builds: ursacomputing/crossbow @ actions-accaa08b45

Task Status
test-r-offline-maximal GitHub Actions

@amoeba amoeba force-pushed the fix/gh-45716--reticulate-failure branch from 797afd3 to c76756e Compare April 10, 2025 01:16
@amoeba amoeba marked this pull request as ready for review April 10, 2025 01:16
@amoeba
Copy link
Member Author

amoeba commented Apr 10, 2025

I had hoped to exercise the new helper code (I still can) but I figured something out that makes me think we can just merge this as-is.

The skip I mentioned above was actually because "Python not available" not because we fail the version check as I had hoped. This happens due to what appears to be a bug in reticulate which is confusing because it's a very basic thing to have not work. The code in this PR uses reticulate::py_discover_config() which claims to tell us what reticulate will find when it goes looking for a Python installation. The documentation claims it follows Order of Discovery which, if you read all the way through, item 15 says it will search the PATH for python or python3.

However, in a VM with R and python3 in the PATH, I get,

> py_discover_config()
NULL

This seems to be a bug and may explain why none of our CI jobs actually run the reticulate tests @jonkeane. If I explicitly tell reticulate which Python to use, this new helper works fine,

> Sys.setenv("RETICULATE_PYTHON"="/usr/bin/python3")
> py_discover_config()
python:         /usr/bin/python3
libpython:      /usr/lib/python3.12/config-3.12-aarch64-linux-gnu/libpython3.12.so
pythonhome:     //usr://usr
version:        3.12.7 (main, Feb  4 2025, 14:46:03) [GCC 14.2.0]
numpy:           [NOT FOUND]

@jonkeane
Copy link
Member

This seems to be a bug and may explain why none of our CI jobs actually run the reticulate tests @jonkeane. If I explicitly tell reticulate which Python to use, this new helper works fine,

Do our force all tests checks actually run this? Or are those skipping there too?

Copy link
Member

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Yeah, I definitely agree this is an improvement even if it's not totally what we were hoping for

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Apr 10, 2025
@amoeba
Copy link
Member Author

amoeba commented Apr 10, 2025

Do our force all tests checks actually run this? Or are those skipping there too?

It seems so, in the logs of the AMD64 Ubuntu 24.04 R 4.4 Force-Tests true check:

2025-04-09T23:35:56.4750365Z Start test: install_pyarrow
2025-04-09T23:35:56.4750466Z Using Python: /usr/bin/python3.12
2025-04-09T23:35:56.4750588Z Creating virtual environment 'arrow-test' ..

I'm not sure reticulate picks up /usr/bin/python3.12 there but not in my local testing though. So it's not that we're not running the reticulate checks but there's maybe something special going on in this check.

@amoeba amoeba merged commit 409a016 into apache:main Apr 10, 2025
23 checks passed
@amoeba amoeba removed the awaiting merge Awaiting merge label Apr 10, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 409a016.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Apr 15, 2025
…tialize reticulate (apache#46079)

### Rationale for this change

This fixes our `test-r-offline-maximal` job which started failing because of a change in reticulate 1.41.0.

### What changes are included in this PR?

Changed internals of our skip_on_python_older_than helper.

### Are these changes tested?

Locally, need to test in CI before merging.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#45716

Authored-by: Bryce Mecum <[email protected]>
Signed-off-by: Bryce Mecum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants