Skip to content

[INGESTION] If relationship creation fails, categories can be created without parents #105

@zaeema-n

Description

@zaeema-n

The exception handling for updating the parent entity with a new relationship is problematic. It catches a broad Exception, prints a warning, and then continues. This can leave the database in an inconsistent state where a category entity is created but not linked to its parent (it becomes an orphan). This could cause issues later.

For a more robust script, you should consider either:

  • Failing the script immediately by re-raising the exception (raise).
  • Implementing a cleanup mechanism to delete the newly created category if the relationship cannot be established.

Silently continuing is risky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions