Skip to content

Fixed issue in which the 0th element of a List caused a TypeError if set to None - #23586

Closed
shourya5 wants to merge 1 commit into
matplotlib:mainfrom
shourya5:issue-fix
Closed

shourya5 wants to merge 1 commit into
matplotlib:mainfrom
shourya5:issue-fix

Conversation

@shourya5

@shourya5 shourya5 commented Aug 8, 2022 •

Copy link
Copy Markdown

PR Summary

closes #23580 wherein a List of datetime.date objects caused a TypeError when the 0th index is None. Fixes the issue by filtering out all None Values in the function safe_first_element, which returns the first not None value.

PR Checklist

Tests and Styling

  • [ x] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@github-actions github-actions 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.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@tacaswell

Copy link
Copy Markdown
Member

Unfortunately we had two people work on this more or less concurrently. I am inclined to favor merging #23587 as it has the same implementation but is already passing CI.

Thank you for your work on this @shourya5 !

@shourya5 shourya5 closed this Aug 9, 2022
@tacaswell

Copy link
Copy Markdown
Member

Thank you for being understanding @shourya5 ! This does not happen very often and I hope we hear from you again.

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.

[Bug]: TypeError when plotting against list of datetime.date where 0th element of list is None

2 participants