Skip to content

Fix cleanup ops for inferred schema #403

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

Merged

Conversation

NathalieCharbel
Copy link
Contributor

@NathalieCharbel NathalieCharbel commented Aug 4, 2025

Description

Fixes AttributeError that occurs during schema cleanup in SchemaFromTextExtractor when LLMs return node/relationship types as strings instead of the expected dictionary format.

Changes:

  • Added defensive type checking in _filter_nodes_without_labels and _filter_relationships_without_labels methods
  • Updated unit tests

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: low

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@NathalieCharbel NathalieCharbel requested a review from a team as a code owner August 4, 2025 15:15
@NathalieCharbel NathalieCharbel changed the title Fix/cleanup ops inferred schema Fix cleanup ops for inferred schema Aug 4, 2025
Copy link
Contributor

@stellasia stellasia left a comment

Choose a reason for hiding this comment

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

I was a bit afraid that we will fix things without knowing what is broken exactly. But in practice, we don't know what the LLM will choose as a label even if the JSON structure is correct, so I convinced myself that this fix is good enough, or at least consistent with the rest of the component :)

Thanks Nathalie!

@NathalieCharbel NathalieCharbel force-pushed the fix/cleanup-ops-inferred-schema branch from 2fe7800 to 48594c6 Compare August 6, 2025 09:11
@NathalieCharbel NathalieCharbel merged commit 9ac5ec5 into neo4j:main Aug 6, 2025
8 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