Skip to content

Conversation

robsdedude
Copy link
Member

@robsdedude robsdedude commented Aug 22, 2025

Instead of for example

GqlStatusObject(gql_status='12345', status_description='descr', position=<SummaryInputPosition object at ...>, raw_classification='HINT', classification=<NotificationClassification.HINT: 'HINT'>, raw_severity='WARNING', severity=<NotificationSeverity.WARNING: 'WARNING'>, diagnostic_record={...})

the repr string representation is now

<GqlStatusObject gql_status='12345', status_description='descr', position=<SummaryInputPosition line=1, column=2, offset=3>, raw_classification='HINT', classification=<NotificationClassification.HINT: 'HINT'>, raw_severity='WARNING', severity=<NotificationSeverity.WARNING: 'WARNING'>, diagnostic_record={...}>

or similar.

This is more in line with Python's recommendations since GqlStatusObject has no such public constructor:

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__

To enable the above change, SummaryInputPosition's repr string representation was also changed to contain more information.

@robsdedude robsdedude marked this pull request as ready for review August 22, 2025 13:02
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.

@robsdedude robsdedude enabled auto-merge (squash) September 8, 2025 16:41
@robsdedude robsdedude merged commit 23207fd into neo4j:6.x Sep 8, 2025
24 checks passed
@robsdedude robsdedude deleted the feat/gql-status-object-repr branch September 8, 2025 17:42
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