diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fbe3b977dba0814757e20366172e750d52827da..5c1ccfd72a026fd855d713743e7ceb7c9f5a8549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed an issue where `caosadvancedtools.cache.UpdateCache` would cause an `sqlite3.IntegrityError` if more than one change was cached for the same entity. +* #40 Insertion of identifiables with missing obligatory properties ### Security ### diff --git a/integrationtests/test_crawl_with_datamodel_problems.py b/integrationtests/test_crawl_with_datamodel_problems.py index 6c212e36084430e5f7c3362a04e78565561019b2..2831bb67ec67f8c2b19519ef5457829712669a6e 100644 --- a/integrationtests/test_crawl_with_datamodel_problems.py +++ b/integrationtests/test_crawl_with_datamodel_problems.py @@ -89,5 +89,6 @@ def test_crawler_with_data_model_problems(): # There should be datamodel problems assert len(DataModelProblems.missing) > 0 + # Deleted entities should have been identified: - assert deleted_entities.issubset(DataModelProblems.missing) + assert DataModelProblems.missing.issubset(deleted_entities) diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py index 0a36284a7aac3a2775d598ab6816cb974e0a87ce..747c533d7a4652434f967147d8a53d1847cfbb4e 100644 --- a/src/caosadvancedtools/crawler.py +++ b/src/caosadvancedtools/crawler.py @@ -544,8 +544,8 @@ carefully and if the changes are ok, click on the following link: try: if len(cfood.to_be_updated) > 0: logger.info( - "Updating {} Records...".format( - len(cfood.to_be_updated))) + "Updating {} Records...".format( + len(cfood.to_be_updated))) guard.safe_update(cfood.to_be_updated, unique=False) except FileNotFoundError as e: logger.info("Cannot access {}. However, it might be needed for" @@ -610,7 +610,8 @@ carefully and if the changes are ok, click on the following link: logger.info( "Inserting {} Records...".format( len(missing_identifiables))) - guard.safe_insert(missing_identifiables, unique=False) + guard.safe_insert(missing_identifiables, unique=False, + flags={"force-missing-obligatory": "ignore"}) except Exception as e: DataModelProblems.evaluate_exception(e)