Repository navigation
Conversation
CanReader
left a comment
There was a problem hiding this comment.
The fix is correct and matches the writer, which already opens the file with encoding="utf-8". Problem is the test: it stubs streamlit, graphviz and the hamilton integration but not matplotlib, and burr/integrations/streamlit.py imports matplotlib.colors in the same try block. CI installs .[tests,tracking-client,tracking-server,graphviz] which has no matplotlib, so the test fails with ImportError: Missing plugin streamlit!. I got exactly that locally, and after installing matplotlib it passes (and fails on main, so the test itself is good). Stubbing matplotlib.colors too, or pytest.importorskip("matplotlib"), should fix it.
Smaller things:
- The module is imported while the deps are stubbed and then stays in
sys.modules, so a later test importing it would get the stubbed version. Nothing else imports it today, butmonkeypatch.delitem(sys.modules, "burr.integrations.streamlit", raising=False)before the import would keep it clean. - Since you're on that line,
with open(...) as f:would also close the file handle, it's never closed right now (not from this PR). - Just FYI, the default logger writes with
json.dumpsandensure_ascii=True, so normal logs are ASCII anyway. This mostly matters for customjson_dumpor other tools on Windows. Still a good fix, maybe worth saying in the description.
|
Thanks for the careful review. I reproduced the missing-matplotlib failure in an isolated Python 3.9 environment. c31b0c2 adds the matplotlib/colors stubs and loads the integration under a temporary module name, so the stubbed module does not remain cached as burr.integrations.streamlit. The reader now closes the log with a context manager, and the test checks that too. The focused regression passes without installing matplotlib; Black, isort, Flake8, license-header checks and diff checks pass. I have not run the full optional-integration suite. Current head checks show successful labeling/mergeability checks, not a full test run. Agreed on scope: the UTF-8 fix matters for custom serializers or externally produced non-ASCII logs; the default ensure_ascii=True writer generally produces ASCII. CI follow-up: the workflow-runs API reports Build Burr and Release Validation as action_required on this head, and documentation as startup_failure. No test jobs have run in those workflows. I have not changed the workflows or rerun them; the full CI result remains unverified. |
|
Thanks for the quick update. I pulled last commit now and ran it with the same deps CI installs (without matplotlib): the test passes now, and it still fails if I put back main's There's one tiny optional thing you can do: the test uses About CI, I think that's just the first time contributor approval, a maintainer needs to approve the runs. Nothing else to do, hope maintainer sees this soon. Good luck! |
|
Thank you for checking the regression against both versions. I made the explicit importlib.util import in 07de89a and reran the focused Python 3.9 test plus formatting/lint checks successfully. The new head still reports Build Burr/Release Validation as action_required and documentation as startup_failure; I have left those workflows alone. |
Summary
Verification
python -m pytest tests/integrations/test_streamlit.py -qpython -m py_compile burr/integrations/streamlit.py tests/integrations/test_streamlit.pygit diff --check