Skip to content

Commit d61a34b

Browse files
CI(dependabot): Bump actions/upload-artifact from 6 to 7 (#76)
* CI(dependabot): Bump actions/upload-artifact from 6 to 7 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * CI: Fix min_versions job * Build: Bump luigi-tools and fix results with Pandas>=3 * Build: Bump Sphinx --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adrien Berchet <adrien.berchet@epfl.ch>
1 parent b80bf3e commit d61a34b

5 files changed

Lines changed: 32 additions & 11 deletions

File tree

.github/workflows/run-tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
name: "data-validation-framework-py${{ matrix.python-version }}-${{ matrix.min_versions }}"
6868
token: ${{ secrets.CODECOV_TOKEN }}
6969
- name: Upload test artifacts
70-
uses: actions/upload-artifact@v6
70+
uses: actions/upload-artifact@v7
7171
if: always()
7272
with:
7373
name: tests-${{ matrix.python-version }}-${{ matrix.min_versions }}

data_validation_framework/util.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ def _apply_to_df_internal(data):
7373
return num, df.apply(_tqdm_wrapper, axis=1, args=args, **kwargs)
7474

7575

76+
def _restore_object_nulls(result_df, template_df):
77+
"""Restore None values for columns that were object-typed in the input."""
78+
for col, dtype in template_df.dtypes.items():
79+
if col in result_df.columns and pd.api.types.is_object_dtype(dtype):
80+
result_df[col] = result_df[col].astype(object)
81+
result_df.loc[result_df[col].isna(), col] = None
82+
return result_df
83+
84+
7685
def tqdm_worker(progress_bar, tqdm_queue):
7786
"""Update progress bar using the Queue."""
7887
while True:
@@ -155,7 +164,7 @@ def apply_to_df(df, func, *args, nb_processes=None, redirect_stdout=None, **kwar
155164
progress_bar.close()
156165

157166
# Return the results
158-
return all_res
167+
return _restore_object_nulls(all_res, df)
159168

160169

161170
def try_operation(row, func, *args, **kwargs):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
reqs = [
99
"luigi>=3.1",
10-
"luigi-tools>=0.0.18",
10+
"luigi-tools>=0.3.5",
1111
"numpy>=1.21",
1212
"pandas>=1.3",
1313
"rst2pdf>=0.99",
@@ -17,7 +17,7 @@
1717
doc_reqs = [
1818
"docutils<0.21", # Temporary fix for m2r2
1919
"m2r2",
20-
"sphinx",
20+
"sphinx>=7.4,<9",
2121
"sphinx-bluebrain-theme",
2222
]
2323
test_reqs = [

tests/test_task.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
SKIP_IF_NO_LATEXMK = not which("latexmk")
3333
REASON_NO_LATEXMK = "The command latexmk is not available."
34+
# Newer Sphinx/TeX stacks slightly shift pagination while keeping the report content intact.
35+
LATEXPDF_DIFF_THRESHOLD = 15
3436

3537

3638
@pytest.fixture
@@ -2107,7 +2109,9 @@ def test_latexpdf(
21072109
assert (root / "TestWorkflow" / "report.csv").exists()
21082110
assert (root / "report_TestWorkflow.pdf").exists()
21092111
assert pdfdiff(
2110-
root / "report_TestWorkflow.pdf", data_dir / "test_report" / "report_latexpdf.pdf"
2112+
root / "report_TestWorkflow.pdf",
2113+
data_dir / "test_report" / "report_latexpdf.pdf",
2114+
threshold=LATEXPDF_DIFF_THRESHOLD,
21112115
)
21122116

21132117
def test_fail_element_no_exception(
@@ -2443,7 +2447,7 @@ def test_latexpdf(self, tmpdir, dataset_df_path, data_dir, TestWorkflow):
24432447
assert pdfdiff(
24442448
root / "TestWorkflow_specifications.pdf",
24452449
data_dir / "test_report_before_run" / "report_latexpdf.pdf",
2446-
threshold=15,
2450+
threshold=LATEXPDF_DIFF_THRESHOLD,
24472451
)
24482452

24492453
@pytest.fixture
@@ -2502,6 +2506,7 @@ def test_latexpdf_with_config(
25022506
assert pdfdiff(
25032507
root / "TestWorkflow_specifications.pdf",
25042508
data_dir / "test_report_before_run" / "report_latexpdf_with_config.pdf",
2509+
threshold=LATEXPDF_DIFF_THRESHOLD,
25052510
)
25062511

25072512
def test_nested_workflows(

tox.ini

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,18 @@ commands =
5555
[testenv:min_versions]
5656
basepython = python3.9
5757
deps =
58-
Requirements-Builder
58+
uv
59+
allowlist_externals =
60+
uv
5961
commands_pre =
60-
requirements-builder --level=min --extras=test -o {envtmpdir}/requirements_min.txt setup.py
61-
pip install -r {envtmpdir}/requirements_min.txt
62-
pip freeze
62+
uv pip compile \
63+
--python {envpython} \
64+
--resolution lowest-direct \
65+
--extra test \
66+
--output-file {envtmpdir}/requirements_min.txt \
67+
setup.py
68+
uv pip install --python {envpython} -r {envtmpdir}/requirements_min.txt
69+
uv pip freeze --python {envpython}
6370

6471
[testenv:lint]
6572
basepython = python3.9
@@ -81,7 +88,7 @@ commands =
8188
pre-commit run --all-files
8289

8390
[testenv:docs]
84-
basepython = python3.9
91+
basepython = python3.11
8592
changedir = docs
8693
extras = docs
8794
allowlist_externals =

0 commit comments

Comments
 (0)