Skip to content

SWR pydata__xarray-3900 - #51

Open
richeshgupta wants to merge 1 commit into
swr-base-793f7fdfrom
swr-head-793f7fd
Open

richeshgupta wants to merge 1 commit into
swr-base-793f7fdfrom
swr-head-793f7fd

Conversation

@richeshgupta

Copy link
Copy Markdown

SWRBench case pydata__xarray-3900: pinned base 6378a71 to head 793f7fd of pydata#3900. Benchmark replay, not for merge.

@razorpay-slash razorpay-slash Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated code review

Reviewed up to 793f7fd.
All 5 reviewers completed.

Comment thread xarray/core/formatting.py
max_width = OPTIONS["display_width"]
max_width_options = OPTIONS["display_width"]
if not isinstance(max_width_options, int):
raise TypeError(f"`max_width` value of `{max_width}` is not a valid int")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Untested display_width type guard raises a TypeError that always reports the offending value as None

Issue

The new guard on OPTIONS['display_width'] is reachable via xr.set_options(display_width='80') followed by any Dataset repr, but no test added or updated in this diff exercises the raise. When it fires, max_width is still None, so the f-string interpolates the parameter rather than max_width_options and the message never shows the actual offending value.

Evidence

SUSPECTED: the raise executes only when max_width is None, so the message renders None instead of the offending value, and no test in the diff reaches the raise. A test in xarray/tests/test_options.py — with pytest.raises(TypeError, match='80'): with xr.set_options(display_width='80'): repr(ds) — would settle it and fails as written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants