Skip to content

Conversation

robsdedude
Copy link
Member

@robsdedude robsdedude commented Aug 21, 2025

Instead of for example {'nodes_created': 42, 'labels_removed': 0, '_contains_system_updates': True} the repr string representation is now SummaryCounters({'nodes-created': 42, 'labels-removed': 0, 'contains-system-updates': True}) or similar.

This is more in line with Python's recommendations:

If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible, a string of the form <...some useful description...> should be returned.

-- https://docs.python.org/3/reference/datamodel.html#object.__repr__

Further, the str representation has been adjusted from for instance {'nodes_created': 42, 'labels_removed': 0, '_contains_system_updates': True} to SummaryCounters{nodes_created: 42, contains_updates: True, contains_system_updates: True} representing all non-default attributes/properties of the object.

@robsdedude robsdedude force-pushed the feat/summary-counters-repr branch from 19ddf5e to 17656c7 Compare August 21, 2025 13:50
@robsdedude robsdedude marked this pull request as ready for review August 21, 2025 16:03
Copy link
Contributor

@MaxAake MaxAake left a comment

Choose a reason for hiding this comment

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

✅ ✏️
Just a minor spelling error in tests

@robsdedude robsdedude enabled auto-merge (squash) August 22, 2025 14:05
@robsdedude robsdedude merged commit 6a98a8e into neo4j:6.x Aug 22, 2025
24 checks passed
@robsdedude robsdedude deleted the feat/summary-counters-repr branch August 22, 2025 15:05
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