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

write_graphml: Small fix for object type description on TypeError exception #7109

Merged
merged 1 commit into from Nov 13, 2023

Conversation

nelsonaloysio
Copy link
Contributor

Fixes a small issue when calling networkx.write_graphml on a graph with invalid attribute types (e.g., a list).

The exception message raised by networkx currently displays an unhelpful error message, which reads:

TypeError: GraphML does not support type <class 'type'> as data values.

This PR simply fixes it to display the object type that is causing the exception, such as in:

TypeError: GraphML does not support type <class 'list'> as data values.

Copy link
Member

@dschult dschult left a comment

Choose a reason for hiding this comment

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

Thanks very much for this!

@MridulS MridulS merged commit d80dfd7 into networkx:main Nov 13, 2023
39 of 40 checks passed
@jarrodmillman jarrodmillman added this to the 3.3 milestone Nov 13, 2023
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
… exception (networkx#7109)

Small fix for object type description on `TypeError` exception.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants