Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix x and y axis naming in dendrogram trace #4411

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Fix x and y axis naming in dendrogram trace #4411

merged 1 commit into from
Nov 6, 2023

Conversation

Brainor
Copy link
Contributor

@Brainor Brainor commented Nov 3, 2023

It's a very simple bug, so I don't think it needs any additional tests or even deserves a changelog entry 😢

try:
x_index = int(self.xaxis[-1])
except ValueError:
x_index = ""
try:
y_index = int(self.yaxis[-1])
except ValueError:
y_index = ""
trace["xaxis"] = "x" + x_index
trace["yaxis"] = "y" + y_index

If x_index is int from line 381, line 390 will cause TypeError: can only concatenate str (not "int") to str from concatenating str("x") and int(3).
The error could accur when someone tries to create a dendrogram plot in a subplot in which the xaxis's name is not xaxis but xaxis3.

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
  • I have added tests (if submitting a new feature or correcting a bug) or modified existing tests.
  • For a new feature, I have added documentation examples in an existing or new tutorial notebook (please see the doc checklist as well).
  • I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
  • For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃 Very nice, thanks. I do think we could include a changelog entry if you'd like to add one, but you're right we can do without extra tests.

CHANGELOG.md Show resolved Hide resolved
@alexcjohnson alexcjohnson merged commit ba47b31 into plotly:master Nov 6, 2023
4 checks passed
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.

2 participants