Skip to content

Fix relplot crash when style argument used with empty dataset#3915

Open
Jovaun1 wants to merge 1 commit into
mwaskom:masterfrom
Jovaun1:fix-relplot-empty-style
Open

Fix relplot crash when style argument used with empty dataset#3915
Jovaun1 wants to merge 1 commit into
mwaskom:masterfrom
Jovaun1:fix-relplot-empty-style

Conversation

@Jovaun1

@Jovaun1 Jovaun1 commented Mar 15, 2026

Copy link
Copy Markdown

This pull request fixes Issue #3870 where seaborn relplot() fails
when an empty dataset is passed with a style argument.

The issue occurs because style levels can become None when the dataset
is empty, causing a TypeError when the code attempts to iterate over them.

This fix ensures style_order defaults to an empty iterable when style
levels are None, preventing the error.

Tested locally using an empty DataFrame to confirm the function
executes without errors.

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.

1 participant