diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32c915cc7..62294a283 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - types-requests args: ["."] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.8.4 hooks: - id: ruff - id: ruff-format diff --git a/message_ix/tests/test_report.py b/message_ix/tests/test_report.py index 25e721be2..53f8f7d94 100644 --- a/message_ix/tests/test_report.py +++ b/message_ix/tests/test_report.py @@ -204,30 +204,34 @@ def add_tm(df, name="Activity"): assert not any(c in df2.columns for c in ["h", "m", "t"]) # Variable names were formatted by the callback - reg_var = pd.DataFrame( - [ - ["seattle", "Activity|canning_plant|production"], - ["seattle", "Activity|transport_from_seattle|to_new-york"], - ["seattle", "Activity|transport_from_seattle|to_chicago"], - ["seattle", "Activity|transport_from_seattle|to_topeka"], - ["san-diego", "Activity|canning_plant|production"], - ["san-diego", "Activity|transport_from_san-diego|to_new-york"], - ["san-diego", "Activity|transport_from_san-diego|to_chicago"], - ["san-diego", "Activity|transport_from_san-diego|to_topeka"], - ], - columns=["region", "variable"], - ) if sys.version_info >= (3, 10) else pd.DataFrame( - [ - ["san-diego", "Activity|canning_plant|production"], - ["san-diego", "Activity|transport_from_san-diego|to_chicago"], - ["san-diego", "Activity|transport_from_san-diego|to_new-york"], - ["san-diego", "Activity|transport_from_san-diego|to_topeka"], - ["seattle", "Activity|canning_plant|production"], - ["seattle", "Activity|transport_from_seattle|to_chicago"], - ["seattle", "Activity|transport_from_seattle|to_new-york"], - ["seattle", "Activity|transport_from_seattle|to_topeka"], - ], - columns=["region", "variable"], + reg_var = ( + pd.DataFrame( + [ + ["seattle", "Activity|canning_plant|production"], + ["seattle", "Activity|transport_from_seattle|to_new-york"], + ["seattle", "Activity|transport_from_seattle|to_chicago"], + ["seattle", "Activity|transport_from_seattle|to_topeka"], + ["san-diego", "Activity|canning_plant|production"], + ["san-diego", "Activity|transport_from_san-diego|to_new-york"], + ["san-diego", "Activity|transport_from_san-diego|to_chicago"], + ["san-diego", "Activity|transport_from_san-diego|to_topeka"], + ], + columns=["region", "variable"], + ) + if sys.version_info >= (3, 10) + else pd.DataFrame( + [ + ["san-diego", "Activity|canning_plant|production"], + ["san-diego", "Activity|transport_from_san-diego|to_chicago"], + ["san-diego", "Activity|transport_from_san-diego|to_new-york"], + ["san-diego", "Activity|transport_from_san-diego|to_topeka"], + ["seattle", "Activity|canning_plant|production"], + ["seattle", "Activity|transport_from_seattle|to_chicago"], + ["seattle", "Activity|transport_from_seattle|to_new-york"], + ["seattle", "Activity|transport_from_seattle|to_topeka"], + ], + columns=["region", "variable"], + ) ) assert_frame_equal(df2[["region", "variable"]], reg_var)