Skip to content

GH-16147: Add new python support - #16817

Open
tomasfryda wants to merge 137 commits into
rel-3.46.0from
tomf_GH-16147_add_new_python_support
Open

GH-16147: Add new python support#16817
tomasfryda wants to merge 137 commits into
rel-3.46.0from
tomf_GH-16147_add_new_python_support

Conversation

@tomasfryda

Copy link
Copy Markdown
Contributor

@tomasfryda tomasfryda self-assigned this Apr 24, 2026
@tomasfryda
tomasfryda force-pushed the tomf_GH-16147_add_new_python_support branch 5 times, most recently from 83ea089 to 283eeae Compare April 30, 2026 13:53
@tomasfryda
tomasfryda force-pushed the tomf_GH-16147_add_new_python_support branch 3 times, most recently from 54d6c20 to 1155ab7 Compare May 7, 2026 15:40
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

1 similar comment
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@tomasfryda
tomasfryda force-pushed the tomf_GH-16147_add_new_python_support branch from 1fad7b2 to dff8a71 Compare June 8, 2026 11:58
tomasfryda added 18 commits June 8, 2026 14:00
…th the old version from the time dev-python-base was built
- utilsPY.py: replace `import imp` with `import importlib.util` and
  convert imp.find_module('numpy') try/except to find_spec None-check
- pyunit_h_pubdev-8768_synthetic_data.py: same migration for
  sklearn_gbmi presence check
- kmeans_aic_bic_diagnostics.ipynb: remove import imp, add importlib.util,
  convert two try/except imp.find_module blocks (pandas, seaborn) to
  find_spec None-check pattern with if-guard imports
- turbofan_NOPASS_phm.ipynb: replace import imp and four-library
  try/except block with h2o_only flag using all(find_spec()) check
…BYTE-01)

- Tests confirm tuple-precedence bug: current code returns ast.Tuple, not ast.Compare
- Behavioural tests verify correct True/False returns for skip/non-skip opcodes
- RED: test_should_be_skipped_uses_set_literal fails (Tuple vs Set comparator)
- Replace tuple expression with set literal so membership test is correct
- Before: `return instr in "COPY_FREE_VARS", "RESUME", "PUSH_NULL"` always truthy
- After: `return instr in {"COPY_FREE_VARS", "RESUME", "PUSH_NULL"}` correct bool
…BYTE-02..05)

- Remove _unpack_opargs try/except block (private API removed in Python 3.12)
- Remove import sys (no longer needed after rewrite)
- Rewrite _disassemble_lambda to use dis.get_instructions() public API
- Normalize RETURN_CONST (3.12+) to LOAD_CONST + RETURN_VALUE
- Normalize LOAD_FAST_LOAD_FAST (3.13+) to two LOAD_FAST entries
- Fix _call_bc: only skip PRECALL if instruction is actually PRECALL (3.12+ guard)
- BINARY_OPS table confirmed correct, no changes needed (D-05)
…a (GH-16147)

- Update version warning string from 3.11.x to 3.14.x (META-01)
- Add Python 3.12, 3.13, 3.14 classifiers to setup.py (META-02)
- Confirmed no bare datatable module-level imports in tests (DEP-03 satisfied by test-requirements.txt)
…ath (VAL-05)

The py3.7-changed-only CI stage copies test files to a separate directory,
breaking the relative ../../h2o/astfun.py path. Use h2o.__file__ to locate
astfun.py via the installed package, which works regardless of workspace layout.
…L-02, VAL-03, VAL-04)

Modern numpy (1.23+) passes str to converter callbacks, not bytes. The legacy
.decode() call dates from 2014-2016 py2/3 compat work and breaks on Python
3.12+ where newer numpy is required. Removing .decode() works on the numpy
versions used across all supported Python versions in CI.
Older numpy on Py3.7-3.10 still passes bytes to converters; numpy 1.23+ on
Py3.11+ passes str. Handle both via isinstance(s, bytes) check.
…AL-02..04)

On Py3.12+, native xgboost is pinned to 3.2.0 which diverges from H2O's
bundled xgboost output. Compare H2O against native (xgboost 1.7.6) on
Py<3.12, and against a baseline value gathered from a Py3.11 run on Py>=3.12.
H2O's bundled xgboost is consistent across Python versions, so the same
baseline applies to all rows.
…(VAL-02..04)

pandas.util.testing was deprecated in pandas 1.0 (Jan 2020) and removed in
pandas 2.0 (April 2023). pandas.testing has been the canonical path since
pandas 1.0, so the migration works on all Python versions in CI.
…AL-04)

Newer sklearn (1.6+, used on Py3.12+) made check_is_fitted stricter: it now
requires either a trailing-underscore attribute or __sklearn_is_fitted__()
method. The H2O wrapper sets self._estimator after fit() but had neither
signal, so pipeline.predict() raised NotFittedError despite fit() having
succeeded. Adding the protocol method works on all sklearn 1.x versions.
…VAL-02..04)

statsmodels<0.14 returned NaN for Tweedie loglike(eql=False), causing the AIC
comparison to silently pass via NaN propagation. statsmodels 0.14+ implements
the actual Wright-Bessel based likelihood, exposing a real disagreement: H2O
estimates phi by ML (golden-section), statsmodels uses Pearson chi^2 / df_resid
in GLM.fit() by default. Same per-observation log-likelihood formula, different
phi → ~32 llf gap (~62 in AIC) over 380 obs, exactly the curvature cost of
evaluating ML at a non-ML phi.

Apply the same pattern the Gamma sub-test uses (lines 95-104): pin H2O's
dispersion to sm.scale via fix_dispersion_parameter + init_dispersion_parameter
so both implementations evaluate Tweedie density at the same phi.
Python 3.14 added LOAD_FAST_BORROW and LOAD_FAST_BORROW_LOAD_FAST_BORROW
opcodes — variants of LOAD_FAST that skip the refcount increment when the
following instruction won't consume the reference. Functionally equivalent
to LOAD_FAST for AST extraction (we only need the variable name).

Without this normalization, lambdas like `lambda x: x.mean()` fail on Py3.14
with "Unexpected bytecode disassembly" because the disassembler emits
LOAD_FAST_BORROW where Py3.13 emitted LOAD_FAST.
Replace direct 'setup.py bdist_wheel' invocation (deprecated by setuptools)
with 'python -m build --wheel --no-isolation' for h2o-py, h2o-py-mlflow-flavor
and h2o-py-cloud-extensions; add [build-system]-only pyproject.toml files.
Metadata deliberately stays in setup.py: the conda recipes harvest it via
load_setup_py_data() and install through legacy 'setup.py install' on the
pinned-old release toolchain — moving to [project] must ship with the conda
modernization and a test release. The client variant is selected via
H2O_PY_CLIENT env var under PEP 517 (argv --client kept for conda build.sh).

Remove '[bdist_wheel] universal = 1' (py2 support is gone; setuptools warns
this will become a build error): wheels are now py3-none-any. Updated the
live name references (release pipeline, install-clients, local_dev, ec2
script with old-release fallback); CI test stages use wildcard globs and are
unaffected.

Verified on CPython 3.14.5 + setuptools 82: all four wheels build warning-free
with correct names (h2o / h2o_client), main wheel installs and imports.
…stages

invokeStage() in defineTestStages.groovy had its own DEFAULT_PYTHON = '3.7',
shadowing buildConfig.DEFAULT_PYTHON_VERSION. Stages without an explicit
pythonVersion (R smokes, Java smokes, Flow) activated
/envs/h2o_env_python3.7 inside the rebuilt dev-r-*/dev-jdk-* images, which
now only contain the 3.14 env — failing with 'No such file' before any
results were produced (PR-16817 #102). Wire the default to
buildConfig.DEFAULT_PYTHON_VERSION so there is a single source of truth.
Hadoop stages pin pythonVersion '3.7' explicitly against their own image
family and are unaffected.

Also clear the 9 invalid-escape SyntaxWarnings in scripts/run.py (same
token-level backslash doubling as the R generator fix; regexes unchanged).
The exists-check + makedirs pattern in _process_response races when parallel
clients save into the same directory: the assembly-to-mojo2 stage runs 6
test processes sharing one freshly-wiped results dir, and two concurrent
download_mojo calls hit the window between the check and makedirs —
FileExistsError surfaced as a misleading 'Cannot write to file'. Flaky on
any Python version; use os.makedirs(exist_ok=True).
python -m build (PEP 517 wheel build) needs the `build` package, but it was
only listed in test-requirements.txt. The wheel tasks run at build time and
their guard, verifyDependencies, checks requirements.build in conda meta.yaml,
which lacked `build` -- so the missing module slipped past and the build failed
later with a cryptic "No module named build". Declare it so the check reports
a clear pip-install message instead.
shap_values_drf.ipynb migrated from boston (506 rows) to california
(~20k rows); the full-frame predict_contributions over a 100-tree,
max_depth-20 DRF overran the demo-notebook node. Cap to ntrees=50,
max_depth=10 (TreeSHAP cost scales ~ leaves * depth^2 per row).
…metadata consistency

- Nightly now runs a single-node pyunit stage per supported Python version
  (was: full matrix untested; 3.8-3.10 never run, 3.12/3.13 smoke-only).
- Gate conda release to CONDA_PYTHON_VERSIONS (3.7-3.11) - the legacy
  conda-build 3.21.9 release image cannot build 3.12+; PyPI wheels still ship them.
- Extend h2o-py-cloud-extensions / h2o-py-mlflow-flavor classifiers and
  python_requires to 3.14 to match h2o-py.
- Document the H2OFrame.apply() free-function-lambda ValueError breaking change.
- Comment the supervised-only invariant on sklearn target_tags.required.
- Add pyunit_supported_python_versions_consistency.py asserting the supported
  range agrees across buildConfig, the runtime guard, all setup.py, and docs.
The test reads buildConfig.groovy, the setup.py files and docs to cross-check
the supported Python range. The 'Changed Only' pyunit stage runs from a stripped
tree where those files are absent, so it errored. Locate the repo root via the
buildConfig.groovy marker (also trying the installed h2o package location) and
skip cleanly when the full source checkout is not reachable.
Guard explanation-plot output against the newly supported Python versions by
snapshotting the JVM-computed plot content (partial dependence, ICE, residuals,
variable importance, model correlation, SHAP) and comparing it to committed
baselines with numeric tolerance. The snapshot ignores matplotlib's
version-dependent rendering choices, so a single baseline holds across the
Python / numpy / matplotlib matrix. On mismatch the test writes a combined HTML
report rendering every plot with baseline and actual images side by side.
…o root

Default the plot-comparison failure report to the test's own folder (derived
from the baseline path) instead of the harness working directory, so the
artifact stays with the test. Still overridable via $H2O_PLOT_FAILURE_DIR.
…arning, sklearn tags, CV warning dedup

- frame.py: __getitem__ unwraps bare numpy scalars (fr[np.int64(2)] now selects
  a column like fr[2]) so the numpy-2.x scalar-indexing doc claim holds.
- h2o.as_list: forward na_values verbatim so direct user calls surface the
  as_data_frame NA-default FutureWarning; pin the two internal model_base
  callers (permutation_importance, predicted_vs_actual_by_variable) to [""].
- sklearn wrapper: split __sklearn_tags__ into _resolve_estimator_type /
  _populate_typed_tags and widen the tag-dataclass guard to except Exception
  (sklearn 1.6/1.7 may require constructor args); document the classes_
  leader-cache strong ref as intentional.
- cross_validation: drop the module-global warn-once latches; rely on the
  warnings module's own dedup so catch_warnings()/simplefilter() are honored.
- expr.py: clarify why the cached np.generic type can't use can_use_numpy().
- setup.py: log how the client wheel variant was selected (stale H2O_PY_CLIENT).
- Tests: server-free *args/**kwargs astfun guard, bare numpy-scalar indexing,
  e2e classes_/predict dtype + scoring, reworked one-shot CV warning test.
…ead conda dep, version-aware checks

- frame.py: drop the module-global as_data_frame NA-default warning latch in
  favor of the warnings registry, matching cross_validation.py so the
  FutureWarning honors catch_warnings()/simplefilter(); update test to cover
  per-call-site dedup and filter suppression.
- conda/h2o-main/meta.yaml: remove unused 'build >=1.2' build dependency
  (conda build.sh uses legacy setup.py install; absent from h2o-client recipe).
- downloading.rst: note conda packages target Python 3.7-3.11; use pip on 3.12+.
- verify_requirements.py: pick highest installed version numerically, not by
  lexicographic string compare (9.0 vs 10.0).
- install_python_version: quote the read -a here-string; fix matplotlibrc
  nested-quote line.
- setup.py: send the client-variant diagnostic to stderr.
- Add pyunit_astfun_free_function_calls.py covering the free-function ValueError.
PR_PYTHON_VERSIONS now covers the full PYTHON_VERSIONS matrix instead of
the oldest/midpoint/newest subset.
pyunit_native_comparison skipped the H2O-vs-native value comparison whenever
xgboost major >= 2 (i.e. on the new Py3.11+ images that pin xgboost 3.2.0),
degrading to a length-only assert. Rewrite it to use the documented
convert_H2OXGBoostParams_2_XGBoostParams() + convert_H2OFrame_2_DMatrix()
bridge (as the pyunit_PUBDEV_5777 tests already do on xgboost 3.x), which pins
base_score=0.5 and reproduces H2O's encoding so predictions match on all
xgboost versions -- no version skip, no co-installed 1.7.6 needed.

Also fixes a latent assertion bug: the old hand-rolled native side had the
feature/label inverted and compared p0, passing only by coincidence on the
degenerate data. With native modeling the same target as H2O, binary:logistic
output is P(level "1") = H2O's p1 column.
…ntifiable

Under Jenkins, run.py's stdout is a block-buffered pipe. The 'Running test'
line had no flush, so it was only pushed out together with the test's result
line (the next flush point). A hanging test never produces a result, so its
'Running test' line stayed stuck in the buffer and was lost when the stage was
killed -- leaving no record of which test got stuck.
The apply-lambda bytecode path mishandled several CALL_FUNCTION_EX shapes;
all are now bound correctly and covered by server-free regression tests.

- Py3.14 flags inference: key on the kwargs-map producer
  (BUILD_MAP / DICT_MERGE / DICT_UPDATE) instead of a preceding PUSH_NULL.
  On 3.14 a module-global `*iterable` folds the kwargs-NULL slot into
  LOAD_GLOBAL (no standalone PUSH_NULL), so the old heuristic mis-flagged it
  as having kwargs and read the args tuple as **kwargs (TypeError).
- `*args` + explicit kwarg (`f(*a, k=v)`): read the whole BUILD_MAP via
  _build_kwargs instead of skipping the builder and reading a lone scalar.
- inline `*[a, b]` / `*(a, b)`: read builder elements singly; the old
  `insert(0, *new_args)` spread a scalar element and raised TypeError.
- `*a, *b` and `pos, *rest`: walk the BUILD_LIST + LIST_EXTEND chain,
  splicing each source iterable's elements and prepending leading positionals.

Verified against the real astfun parser on Python 3.9, 3.11, 3.12, 3.13, 3.14.
…classes_

Close two test gaps in the new-Python support surface (both server-free):

- pyunit_expr_numpy_args.py (new): assert ExprNode._to_python_scalar /
  _arg_to_expr never leak a numpy-2.x "np.float64(...)" repr into the Rapids
  string — covering numpy scalars, lists, NESTED lists, and slice start/stop/
  step. Previously only a bare fr[np.int64(1)] index was tested. Holds on both
  numpy 1.x and 2.x.
- pyunit_sklearn_classes_array.py: add INT64_MAX+1 overflow case (canonical
  Python int that overflows np.int64 -> falls back to a string array) and the
  exact INT64_MAX boundary (stays int64).

Verified on Python 3.9 (numpy 1.26) and 3.13/3.14 (numpy 2.5, sklearn 1.9).
…7/3.8)

The previous commit's *args/**kwargs rewrite assumed the Py3.9+ bytecode
(BUILD_LIST + LIST_EXTEND / BUILD_MAP + DICT_MERGE) and regressed Python
3.7/3.8, which use the BUILD_*_UNPACK_WITH_CALL family:

- f(*a, *b) / f(pos, *rest): BUILD_TUPLE_UNPACK_WITH_CALL operands are
  iterables to concatenate (explicit positionals are pre-bundled into a
  const-tuple operand) -> spread each. The rewrite read them as single args,
  producing nested tuples (e.g. (scale x [False] [False]) -> JVM
  NumberFormatException).
- f(**d, k=v): BUILD_MAP_UNPACK_WITH_CALL holds the **mapping plus an explicit
  BUILD_MAP; the simplified BUILD_MAP branch mis-read it.

Add is_seq_unpack/is_map_unpack helpers and dedicated branches so 3.7/3.8 keep
their original (correct) handling while 3.9-3.14 keep the LIST_EXTEND/DICT_MERGE
and inline-literal handling. All nine unpack shapes now produce identical Rapids
on Python 3.7, 3.9, 3.11, 3.12, 3.13, 3.14.
…r, packaging

- astfun: fix CALL_FUNCTION_EX multi-source DICT_MERGE loop (crashed on
  f(**a, **b) / f(**a, k=v)) and add BUILD_CONST_KEY_MAP support for 2+ explicit
  kwargs alongside a * / ** unpack; add bytecode-shape regression tests (C1e),
  verified on Python 3.11 and 3.14.
- expr/frame: consolidate the numpy _np_module/_NP_GENERIC/_NP_NDARRAY sentinel
  into a single definition in expr.py (DRY).
- XMLTestReporter: wrap report writer in try-with-resources so a transform()
  failure no longer leaks the FileWriter or leaves a half-written XML.
- setup.py (x3): drop the <3.15 python_requires ceiling so published wheels stay
  installable on future Pythons; the runtime UserWarning handles untested
  versions. Relax the version-consistency test to make the ceiling optional.
- as_data_frame() NA FutureWarning: per-call-site dedup now bypassed when the
  active filter resolves to always/error, honoring simplefilter('always')/-W error.
- cross_validation: keep the historical __iter__ (H2OFrame mask) contract — no
  API break — and add the scikit-learn splitter API split()/get_n_splits()
  (numpy int indices) for sklearn >= 1.6; drop the now-redundant iter_legacy()
  and the inaccurate contract-change FutureWarning.
The is_map_unpack branch (Py<=3.8) read only the top operand plus an optional
trailing builder, silently dropping a second ** unpack — so f(**a, **b) and
f(**a, k=v) mis-bound on 3.7/3.8 (the analogue of the DICT_MERGE bug fixed for
Py>=3.9). Read all n operands of BUILD_MAP_UNPACK_WITH_CALL and merge them
left-to-right. Caught by the new C1e shape tests on the py3.7 CI stage; verified
on real Python 3.7, 3.11, and 3.14.
…mghdr)

The release/docs Python was bumped 3.7->3.14, but the docs build
(make-dist.sh -> sphinx-build) uses the pinned sphinx==3.0.4, whose epub3
builder imports the stdlib `imghdr` module removed in Python 3.13. Both the
h2o-py API docs and the main h2o-docs site fail to build on 3.13+.

The release image bundles a single Python env, set by Dockerfile-r-base's
base image, so the docs interpreter is pinned there. Pin both that base and
Jenkinsfile-Release's PYTHON_VERSION to 3.12 (newest Python that still has
imghdr); the release wheel is py3-none-any so the build interpreter does not
affect the artifact, and conda packaging is capped separately. Revert to 3.14
once docs-requirements.txt is modernized.
The default Python (build image chain + warmup + release pipeline) was 3.14,
but the docs build (make-dist.sh -> sphinx-build) uses the pinned sphinx==3.0.4,
whose epub3 builder imports the stdlib `imghdr` module removed in Python 3.13 —
so the single Python env bundled in the dev-r-base/dev-build-hadoop chain cannot
be 3.13+ until docs-requirements.txt is modernized.

Convert the whole default chain to 3.12 (newest with imghdr):
- DEFAULT_PYTHON_VERSION, Jenkinsfile-Release PYTHON_VERSION, build-h2o-3 fallback,
  Dockerfile-jdk-others-base ENV
- dev-python base for dev-r-base / dev-mojocompat (Dockerfiles + Makefile deps +
  Jenkinsfile-build-docker stash/unstash)

3.14 remains a fully supported and tested version via PYTHON_VERSIONS and the
dev-python-3.14-jdk matrix images; only the default/build interpreter moves.
sphinx==3.0.4 declares no upper bounds, so a fresh resolution on the 3.12
build interpreter pulls jinja2>=3.1 (removed environmentfilter), docutils>=0.21
(dropped bundled roman), setuptools>=81 (no pkg_resources), markupsafe>=2.1,
and sphinxcontrib-*/alabaster that require Sphinx>=5 -- each breaks sphinx-build
before any HTML is rendered. Capping Python at 3.12 only restores imghdr; these
transitive caps are also required. Verified the combined test+docs requirements
still resolve and render on Linux Python 3.12.
Update welcome.rst to note conda packages target Python 3.7-3.11 (use pip
for 3.12+). Exclude bool from the numeric-list branch in
_collect_snapshot_diffs, since bool is a subclass of int and was being
compared as floats.
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@tomasfryda
tomasfryda marked this pull request as ready for review July 7, 2026 12:16
Copilot AI review requested due to automatic review settings July 7, 2026 12:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the H2O-3 Python ecosystem and CI/release tooling to support newer Python versions (defaulting builds to Python 3.12) and to handle upstream library changes (notably numpy 2.x, pandas 2.x, scipy/lifelines, and xgboost 2.x+), while also improving test/reporting robustness in parallel CI environments.

Changes:

  • Expanded the supported/tested Python matrix through 3.14, updated Jenkins defaults, Docker images, and wheel naming (py3-only).
  • Added/updated Python client codepaths and tests to handle numpy 2.x scalar repr/indexing interop, NA-handling changes in as_data_frame, and multiple third‑party API migrations.
  • Improved CI stability: avoid parallel JUnit XML report collisions, flush early test-start logs, and reduce demo-stage resource usage to prevent Jenkins OOM.

Reviewed changes

Copilot reviewed 175 out of 212 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/run.py Fixes invalid-regex escape warnings and flushes stdout immediately when starting tests.
scripts/jenkins/Makefile.jenkins Gates legacy pandas/numpy pins to Py3.7 and reduces demo cluster size/memory to avoid CI OOM.
scripts/jenkins/jenkinsfiles/Jenkinsfile-Single-Test Expands selectable Python versions for single-test runs.
scripts/jenkins/jenkinsfiles/Jenkinsfile-Release Switches release default Python to 3.12, updates wheel tags to py3-only, and restricts conda builds to supported versions.
scripts/jenkins/groovy/buildConfig.groovy Updates Python version matrix/defaults and introduces CONDA_PYTHON_VERSIONS.
scripts/install-clients.sh Updates wheel filename glob to py3-only tag.
h2o-test-support/src/main/java/water/junit/XMLTestReporter.java Prevents parallel JVMs from racing on the same JUnit XML filename (PID suffix + try-with-resources).
h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_pipeline.py Adds an end-to-end regression test for integer classes_ dtype consistency.
h2o-py/tests/testdir_sklearn/pyunit_sklearn_classes_array.py Adds pure-Python regression tests for _classes_array / _is_canonical_int.
h2o-py/tests/testdir_munging/unop/pyunit_math_ops2.py Removes future/old_div usage in favor of native Py3 division.
h2o-py/tests/testdir_munging/pyunit_to_H2OFrame.py Makes jagged numpy array creation explicit via dtype=object for newer numpy behavior.
h2o-py/tests/testdir_munging/pyunit_ifelse.py Removes future/old_div usage in favor of native Py3 division.
h2o-py/tests/testdir_munging/binop/pyunit_binop2_div.py Removes future/old_div usage in favor of native Py3 division.
h2o-py/tests/testdir_misc/pyunit_stratified_split_medium.py Removes future/old_div usage in favor of native Py3 division.
h2o-py/tests/testdir_misc/pyunit_stratified_kfold_medium.py Removes future/old_div usage in favor of native Py3 division.
h2o-py/tests/testdir_misc/pyunit_frame_numpy_indexing.py Adds end-to-end tests for numpy-array indexing semantics on H2OFrame.
h2o-py/tests/testdir_misc/pyunit_expr_numpy_args.py Adds regression tests ensuring numpy scalar repr never leaks into Rapids args.
h2o-py/tests/testdir_misc/pyunit_export_parquet_multi.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_misc/pyunit_export_file.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_misc/pyunit_export_file_multi.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_misc/pyunit_astfun_should_be_skipped.py Adds tests for astfun.should_be_skipped regression (tuple-precedence bug).
h2o-py/tests/testdir_misc/pyunit_astfun_kwarg_order.py Adds tests for correct kwarg ordering across Python bytecode variants.
h2o-py/tests/testdir_misc/pyunit_astfun_free_function_calls.py Adds tests ensuring free-function calls with args raise instead of silently dropping args.
h2o-py/tests/testdir_misc/pyunit_as_data_frame_na_values.py Adds end-to-end tests for new na_values semantics and warning behavior.
h2o-py/tests/testdir_misc/pyunit_apply.py Updates pandas testing import and normalizes dtype for ceil/floor comparisons.
h2o-py/tests/testdir_misc/explain/pyunit_explain_plot_comparison.py Adds deterministic plot-content snapshot tests against committed baselines.
h2o-py/tests/testdir_misc/explain/baselines/varimp_plot.json Baseline for varimp plot snapshot comparison.
h2o-py/tests/testdir_misc/explain/baselines/shap_explain_row.json Baseline for SHAP explain-row plot snapshot comparison.
h2o-py/tests/testdir_misc/explain/baselines/learning_curve.json Baseline for learning-curve plot snapshot comparison.
h2o-py/tests/testdir_jira/pyunit_pubdev_6360.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_jira/pyunit_pubdev_4723.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_hstats/pyunit_h_pubdev-8768_synthetic_data.py Replaces deprecated imp module usage with importlib.util.
h2o-py/tests/testdir_filter/pyunit_drop_duplicates.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_filter/pyunit_drop_duplicates_pandas.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_apis/Data_Manipulation/pyunit_h2oH2OFrame_impute.py Adjusts scipy mode API usage for newer return shapes.
h2o-py/tests/testdir_algos/xgboost/pyunit_xgboost_reweight_tree.py Updates pandas 2.0 assert_frame_equal precision tolerance handling.
h2o-py/tests/testdir_algos/xgboost/pyunit_PUBDEV_6117_xgboost_compare.py Removes Python>=3.9 skip and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_PUBDEV_5777_XGBoost_sparse_comparisons.py Updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_PUBDEV_5777_XGBoost_dense_comparisons.py Updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_native_comparison.py Reworks native-vs-H2O comparison to use param/frame conversion helpers and adds determinism pinning.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_numerical_binomial_compare_sparse_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_regression_compare_large_sparse_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_regression_compare_large_dense_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_multinomial_compare_large_sparse_singleNode.py Pins tree_method/base_score for apples-to-apples comparisons and updates native predict API.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_multinomial_compare_large_dense_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_binomial_compare_large_sparse_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_mixed_binomial_compare_large_dense_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_enum_multinomial_compare_sparse_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/xgboost/pyunit_H2OXGBoost_native_XGBoost_enum_binomial_compare_sparse_singleNode.py Pins base_score and updates native predict API to iteration_range.
h2o-py/tests/testdir_algos/rf/pyunit_smallcatRF.py Makes numpy loadtxt converter robust to bytes/str input types.
h2o-py/tests/testdir_algos/kmeans/pyunit_emptyclusKmeans.py Removes old_div and uses integer division where intended.
h2o-py/tests/testdir_algos/kmeans/pyunit_convergeKmeans.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/isofor/pyunit_isofor_grid.py Replaces deprecated pandas append with concat.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8077_multinomial_alpha.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8072_remove_collinear_columns.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8072_remove_collinear_columns_warnings.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_tomasF2.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_tomasF.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_multinomial_lambda_search_generate_scoring_history_cv.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_multinomial_lambda_search_cv.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_multinomial_generate_scoring_history_cv.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7968_scoring_history_glm_multinomial_cv.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_7611_early_stop_glm_multinomial.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_pubdev_7588_interaction_lambda0_higher_cat_levels.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_pubdev_6999_glm_interaction_NA.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_tweedie_vpow_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_tweedie_basic_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_poisson_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_negbinomial_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_gaussian_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_gamma_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_binomial_glm.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/glm/pyunit_glm_interactions_large.py Removes unused old_div import.
h2o-py/tests/testdir_algos/glm/pyunit_aic_glm.py Improves coefficient divergence diagnostics and aligns Tweedie dispersion handling between libs.
h2o-py/tests/testdir_algos/gbm/pyunit_smallcat_gbm.py Makes numpy loadtxt converter robust to bytes/str input types.
h2o-py/tests/testdir_algos/gbm/pyunit_nfold_predict.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/gbm/pyunit_gbm_pojo_import.py Updates deprecated pandas testing import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8877_gam_beta_constraints.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8835_check_knotsKey.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_random_gridsearch_specific.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_random_gridsearch_generic.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_gridsearch_subspaces.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_gridsearch_generic.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_gridsearch_error.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_gam_scale_parameter.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_GAM_ispline_scoring.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_gam_error_messages.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_early_stop_gam_binomial.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_check_varimp_coeffs.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_8398_beta_constraints.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7932_gam_scale_parameter.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7860_PUBDEV_7367_random_gridsearch_subspaces_TP_CS_binomial.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7860_PUBDEV_7367_random_gridsearch_subspaces_thin_plate_gaussian.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7709_gam_error_messages.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7708_check_nlambdas.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7708_check_lambda_min_ratios.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7611_early_stop_gam_binomial.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_random_gridsearch_subspaces.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_random_gridsearch_invalid.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_random_gridsearch_generic.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_subspaces.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_subspaces_invalid.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_specific.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_generic.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_error.py Removes unused old_div import.
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7181_check_varimp_coeffs.py Removes unused old_div import.
h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_weights_deeplearning.py Removes old_div and uses native division.
h2o-py/tests/testdir_algos/coxph/pyunit_coxph_concordance_survival.py Improves baseline naming stability across numpy versions and adds drift/self-consistency checks.
h2o-py/tests/testdir_algos/coxph/pyunit_coxph_baseline_names_shelter.py Fixes pandas 2.x datetime parsing for tz-aware strings.
h2o-py/tests/testdir_algos/automl/pyunit_automl_get_leaderboard.py Updates deprecated pandas testing import.
h2o-py/setup.py Adds env-var based client build switch and updates supported Python classifiers.
h2o-py/setup.cfg Removes universal-wheel configuration (py3-only wheels).
h2o-py/scripts/verify_requirements.py Modernizes installed-package discovery and improves version comparisons.
h2o-py/README.md Updates documented supported Python/numpy version ranges.
h2o-py/pyproject.toml Adds PEP 517/518 build-system configuration (metadata remains in setup.py).
h2o-py/h2o/model/model_base.py Ensures internal as_list calls preserve feature names via na_values=[""].
h2o-py/h2o/model/extensions/scoring_history.py Ensures plotting inputs are plain lists for compatibility across pandas/numpy versions.
h2o-py/h2o/model/extensions/feature_interaction.py Uses a context-managed ExcelWriter to guarantee close on error.
h2o-py/h2o/h2o.py Adds na_values passthrough to as_list and hardens inspect.getsourcelines behavior on Py3.13+.
h2o-py/h2o/expr.py Unwraps numpy scalars to Python scalars to prevent numpy 2.x repr leaking into Rapids strings.
h2o-py/h2o/estimators/xgboost.py Pins native base_score default in param conversion to match bundled xgboost4j behavior.
h2o-py/h2o/backend/connection.py Uses os.makedirs(..., exist_ok=True) to avoid parallel directory-creation races.
h2o-py/h2o/init.py Updates supported Python warning to 3.7–3.14 and uses suppressible warnings.warn.
h2o-py/docs-requirements.txt Pins transitive deps needed for legacy Sphinx 3.0.4 on modern Python.
h2o-py/demos/uplift_drf_demo.ipynb Reduces nbins to reduce resource usage / improve compatibility.
h2o-py/demos/turbofan_NOPASS_phm.ipynb Replaces deprecated imp usage and updates Python 3 print syntax.
h2o-py/demos/tf-idf.ipynb Makes IPython display optional and normalizes unicode progress output.
h2o-py/demos/rulefit_demo.ipynb Makes IPython display optional and normalizes unicode progress output.
h2o-py/demos/Predict_w_Unseen_Categorical_Levels.ipynb Removes deprecated matplotlib warn= arg and normalizes unicode output.
h2o-py/demos/kmeans_aic_bic_diagnostics.ipynb Replaces deprecated imp usage and hardens seaborn detection on modern numpy.
h2o-py/demos/isolationforest_valid.ipynb Replaces deprecated pandas append usage and normalizes unicode progress output.
h2o-py/demos/airlines_demo_small.ipynb Removes deprecated matplotlib warn= arg.
h2o-py/build.gradle Switches wheel build to PEP 517 frontend (python -m build) and includes pyproject.toml in dist sources.
h2o-py-mlflow-flavor/setup.py Updates supported Python classifiers.
h2o-py-mlflow-flavor/setup.cfg Removes universal-wheel configuration (py3-only wheels).
h2o-py-mlflow-flavor/pyproject.toml Adds PEP 517/518 build-system configuration.
h2o-py-mlflow-flavor/build.gradle Switches wheel build to PEP 517 frontend (python -m build).
h2o-py-cloud-extensions/setup.py Updates supported Python classifiers.
h2o-py-cloud-extensions/setup.cfg Removes universal-wheel configuration (py3-only wheels).
h2o-py-cloud-extensions/pyproject.toml Adds PEP 517/518 build-system configuration.
h2o-py-cloud-extensions/build.gradle Switches wheel build to PEP 517 frontend (python -m build).
h2o-hadoop-common/tests_multinode/python/pyunit_NOPASS_kmeans_mllib_1_large.py Removes old_div and uses native division.
h2o-docs/src/product/welcome.rst Updates supported Python versions and documents numpy 2.x compatibility split.
h2o-docs/src/product/flow/SiteIntro.md Updates supported Python versions in Flow docs intro.
h2o-docs/src/product/downloading.rst Removes legacy future install step and clarifies conda vs pip for 3.12+.
h2o-dist/local_dev.py Updates local dev wheel name to py3-only.
h2o-bindings/bin/gen_R.py Fixes R-doc escaping for \\dontrun, \\code, and brace escaping.
h2o-bindings/bin/custom/R/gen_xgboost.py Fixes R-doc \\code{} escaping.
h2o-bindings/bin/custom/R/gen_upliftdrf.py Fixes R-doc \\code{}, \\linkS4class{} and \\link{} escaping.
h2o-bindings/bin/custom/R/gen_svd.py Fixes R-doc \\code{} and \\linkS4class{} escaping.
h2o-bindings/bin/custom/R/gen_rulefit.py Fixes R-doc escaping for \\dontrun.
h2o-bindings/bin/custom/R/gen_pca.py Fixes R-doc \\code{} / \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_naivebayes.py Fixes R-doc \\linkS4class{} escaping.
h2o-bindings/bin/custom/R/gen_kmeans.py Fixes R-doc \\code{} / \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_isotonicregression.py Fixes R-doc \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_isolationforest.py Fixes R-doc \\code{} escaping.
h2o-bindings/bin/custom/R/gen_infogram.py Fixes R-doc \\linkS4class{} / \\code{} / \\dontrun escaping.
h2o-bindings/bin/custom/R/gen_glrm.py Fixes R-doc \\linkS4class{} / \\code{} / \\dontrun escaping.
h2o-bindings/bin/custom/R/gen_glm.py Fixes R-doc \\linkS4class{} / \\code{} escaping.
h2o-bindings/bin/custom/R/gen_gbm.py Fixes R-doc \\code{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_extendedisolationforest.py Fixes R-doc \\code{} escaping.
h2o-bindings/bin/custom/R/gen_dt.py Fixes R-doc \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_drf.py Fixes R-doc \\code{} / \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/R/gen_deeplearning.py Fixes R-doc \\linkS4class{} / \\code{} / \\dontrun escaping.
h2o-bindings/bin/custom/R/gen_aggregator.py Fixes R-doc \\linkS4class{} / \\code{} / \\dontrun escaping.
h2o-bindings/bin/custom/R/gen_adaboost.py Fixes R-doc \\linkS4class{} / \\link{} escaping.
h2o-bindings/bin/custom/python/gen_xgboost.py Mirrors xgboost base_score pinning in generated Python binding stub.
h2o-algos/src/test/java/hex/kmeans/KmeansConstrainedTest.java Reduces constraints/iterations to keep LP path exercised while preventing CI timeouts.
ec2/install_h2o.sh Adds fallback install for older wheel tag (py2.py3) while preferring new py3-only naming.
docker/scripts/build-h2o-3 Updates default PYTHON_VERSION to 3.12 and documents sync requirement with BuildConfig.
docker/Makefile Switches base image deps to Python 3.12 and adds jdk-variant targets for newer Python images.
docker/Jenkinsfile-build-docker Updates persisted docker image list to Python 3.12 base image.
docker/jenkins-images/Dockerfile-release Pins anaconda-client/conda-build versions and removes conda self-update.
docker/jenkins-images/Dockerfile-r-base Rebases R base image on dev-python-3.12.
docker/jenkins-images/Dockerfile-python Copies install script from build context before running it.
docker/jenkins-images/Dockerfile-mojocompat Rebases mojocompat image on dev-python-3.12.
docker/jenkins-images/Dockerfile-jdk-others-base Updates baked-in PYTHON_VERSION to 3.12 for Java test images.
Changes.md Adds release notes for Python 3.12+ support and related breaking changes/behavior updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +24
src = open(os.path.join(os.path.dirname(h2o.__file__), 'astfun.py')).read()
tree = ast.parse(src)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants