Skip to content

Fix failing unit tests for pandas and mlflow compatibility #1463

Merged
skrawcz merged 10 commits intoapache:mainfrom
Exudev:main
Feb 5, 2026
Merged

Fix failing unit tests for pandas and mlflow compatibility #1463
skrawcz merged 10 commits intoapache:mainfrom
Exudev:main

Conversation

@Exudev
Copy link
Contributor

@Exudev Exudev commented Feb 2, 2026

  • Update pd.PeriodIndex() to pd.PeriodIndex.from_fields() for pandas 2.2+
  • Add pytest.importorskip("mlflow") for Python 3.14+ where mlflow isn't installed

Fixes #1450

Exudev and others added 10 commits January 16, 2026 23:37
This update introduces the  tag for nodes in graph visualizations, allowing for human-readable labels while maintaining valid Python identifiers as function names. The changes include:

- Documentation updates to explain the usage of  in visualizations.
- Modifications to the graph creation logic to utilize  when available.
- New tests to ensure  is correctly applied in visualizations and that HTML characters are properly escaped.
- Example functions demonstrating the use of  in a new resource file.

This feature improves the readability of visualizations for stakeholders while keeping the codebase Pythonic.
…special characters are properly escaped in the label.
This update improves the handling of the display_name tag in graph visualizations by adding support for cases where display_name is a list. The first element of the list will now be used as the display name. Additionally, new tests have been added to verify this functionality, ensuring that the correct display names are rendered in the graph output. This enhancement contributes to better readability and usability of visualizations.
- Update PeriodIndex API to use from_fields() for pandas 2.2+ compatibility
- Add pytest.importorskip for mlflow tests on Python 3.14+

Fixes apache#1450
@Exudev Exudev marked this pull request as ready for review February 2, 2026 18:21
@skrawcz
Copy link
Contributor

skrawcz commented Feb 5, 2026

FAILED tests/plugins/test_polars_extensions.py::test_polars_database - ImportError: The SQLAlchemy asyncio module requires that the Python 'greenlet' library is installed. In order to ensure this dependency is available, use the 'sqlalchemy[asyncio]' install target: 'pip install sqlalchemy[asyncio]'

Some more unit test failures -- seems like another library release update that changed dependencies...

created #1466

@skrawcz
Copy link
Contributor

skrawcz commented Feb 5, 2026

and another test failure for python 3.14 -- need to exclude ray.

==================================== ERRORS ====================================
______________ ERROR collecting plugin_tests/h_ray/test_h_ray.py _______________
ImportError while importing test module '/home/runner/work/hamilton/hamilton/plugin_tests/h_ray/test_h_ray.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.14.3-linux-x86_64-gnu/lib/python3.14/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
plugin_tests/h_ray/test_h_ray.py:20: in
import ray
E ModuleNotFoundError: No module named 'ray'
_ ERROR collecting plugin_tests/h_ray/test_parse_ray_remote_options_from_tags.py _
ImportError while importing test module '/home/runner/work/hamilton/hamilton/plugin_tests/h_ray/test_parse_ray_remote_options_from_tags.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/uv/python/cpython-3.14.3-linux-x86_64-gnu/lib/python3.14/importlib/init.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
plugin_tests/h_ray/test_parse_ray_remote_options_from_tags.py:18: in
from hamilton.plugins import h_ray
hamilton/plugins/h_ray.py:25: in
import ray
E ModuleNotFoundError: No module named 'ray'
=========================== short test summary info ============================

created created #1467

Copy link
Contributor

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

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

otherwise this fixes the tests in the ticket. thanks @Exudev

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.

Update unit tests to handle external library changes

2 participants