Skip to content

Attempt to delete one or more records that serve as foreign keys in another table will generate an uncaught exception in run.py #209

@seasidesparrow

Description

@seasidesparrow

In run.py, the --delete -n /path/to/bibcode/list is used to trigger row deletions from master_pipeline.records. In the event one of the fields in this row is used as a foreign key in another table, this will generate a ForeignKeyViolation Error on the sqlalchemy operation. The call to adsmp.tasks.task_delete_documents in run.py is not contained within a try-except, and the task itself doesn't either. The result is that the task generates a fatal exception, and so run.py generates an exception and stops.

elif args.delete:

The task itself should have a try-except on the sqlalchemy delete action as well as the solr delete action.

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