Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- Example: 10.2.1.4 is the 5th version that supports khiops 10.2.1.
- Internals: Changes in *Internals* sections are unlikely to be of interest for data scientists.

## Unreleased

## Fixed
- (`core`) Samples dir path construction when HOME is a remote path

## 11.0.0.1 - 2026-01-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ipykernel>=6.9.1
nbconvert==6.4.4
nbformat==5.3.0
numpydoc>=1.5.0
pandas>=0.25.3
pandas>=0.25.3,<=2.3.3
scikit-learn>=0.22.2,<=1.7.2
sphinx-copybutton>=0.5.0
7 changes: 5 additions & 2 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import io
import os
import pathlib
import platform
import shlex
import shutil
Expand Down Expand Up @@ -65,7 +64,11 @@ def get_default_samples_dir():
elif platform.system() == "Windows" and "PUBLIC" in os.environ:
samples_dir = os.path.join(os.environ["PUBLIC"], "khiops_data", "samples")
else:
samples_dir = str(pathlib.Path.home() / "khiops_data" / "samples")
# The filesystem abstract layer is used here
# as the path can be either local or remote
samples_dir = fs.get_child_path(
fs.get_child_path(os.environ["HOME"], "khiops_data"), "samples"
)
return samples_dir


Expand Down
2 changes: 1 addition & 1 deletion packaging/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
run:
- python
- khiops-core =11.0.0
- pandas >=0.25.3
- pandas >=0.25.3,<=2.3.3
- scikit-learn >=0.22.2
run_constrained:
# do not necessary use the latest version
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ classifiers = [
]
requires-python = ">=3.8"
dependencies = [
"pandas>=0.25.3",
# do not use the latest version, to avoid undesired breaking changes
# do not use the latest versions, to avoid undesired breaking changes
"pandas>=0.25.3,<=2.3.3",
"scikit-learn>=0.22.2,<=1.7.2",
]

Expand Down
27 changes: 27 additions & 0 deletions tests/test_remote_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,33 @@ def test_train_predictor_fail_and_log_with_remote_access(self):
self.assertTrue(fs.exists(log_file_path), f"Path: {log_file_path}")
fs.remove(log_file_path)

def test_samples_dir_inferred_from_remote_home(self):
"""Test samples_dir is correctly inferred using a remote path in HOME"""

# Save initial state
# This runner has remote paths (for root_temp_dir for example)
initial_runner = kh.get_runner()
initial_home = os.environ.get("HOME")

# Set a remote path to HOME
os.environ["HOME"] = initial_runner.root_temp_dir
test_runner = KhiopsLocalRunner()
kh.set_runner(test_runner)

# Test the home path is indeed remote
self.assertFalse(fs.is_local_resource(os.environ["HOME"]))

# Test that samples_dir is built according to the expectations
expected_samples_dir = fs.get_child_path(
fs.get_child_path(os.environ["HOME"], "khiops_data"), "samples"
)
self.assertEqual(test_runner.samples_dir, expected_samples_dir)

# Restore initial state
if initial_home is not None:
os.environ["HOME"] = initial_home
kh.set_runner(initial_runner)


class KhiopsS3RemoteFileTests(KhiopsRemoteAccessTestsContainer.KhiopsRemoteAccessTests):
"""Integration tests with Amazon S3 filesystems"""
Expand Down
Loading