Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
22aa4a3c
Commit
22aa4a3c
authored
May 23, 2023
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
TST: enhance doc and fix test
parent
c93b00c2
No related branches found
No related tags found
2 merge requests
!123
REL: Release v0.6.0
,
!117
ENH: detect circular dependencies
Pipeline
#37039
failed
May 23, 2023
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/caoscrawler/crawl.py
+2
-2
2 additions, 2 deletions
src/caoscrawler/crawl.py
unittests/test_crawler.py
+1
-2
1 addition, 2 deletions
unittests/test_crawler.py
with
3 additions
and
4 deletions
src/caoscrawler/crawl.py
+
2
−
2
View file @
22aa4a3c
...
@@ -641,7 +641,7 @@ class Crawler(object):
...
@@ -641,7 +641,7 @@ class Crawler(object):
+
str
(
self
.
compact_entity_list_representation
(
flat
)))
+
str
(
self
.
compact_entity_list_representation
(
flat
)))
else
:
else
:
logger
.
error
(
"
Found circular dependency (Note that this might include references
"
logger
.
error
(
"
Found circular dependency (Note that this might include references
"
"
that are not identifying properties:
"
"
that are not identifying properties
)
:
"
+
self
.
compact_entity_list_representation
(
circle
))
+
self
.
compact_entity_list_representation
(
circle
))
raise
RuntimeError
(
raise
RuntimeError
(
f
"
Could not finish split_into_inserts_and_updates. Circular dependency:
"
f
"
Could not finish split_into_inserts_and_updates. Circular dependency:
"
...
@@ -681,7 +681,7 @@ class Crawler(object):
...
@@ -681,7 +681,7 @@ class Crawler(object):
"""
"""
Detects whether there are circular references in the given entity list and returns a list
Detects whether there are circular references in the given entity list and returns a list
where the entities are ordered according to the chain of references (and only the entities
where the entities are ordered according to the chain of references (and only the entities
contained in the circle are included.
contained in the circle are included.
Returns None if no circular dependency is found.
TODO: for the sake of detecting problems for split_into_inserts_and_updates we should only
TODO: for the sake of detecting problems for split_into_inserts_and_updates we should only
consider references that are identifying properties.
consider references that are identifying properties.
...
...
This diff is collapsed.
Click to expand it.
unittests/test_crawler.py
+
1
−
2
View file @
22aa4a3c
...
@@ -874,8 +874,7 @@ def test_detect_circular_dependency(crawler_mocked_identifiable_retrieve, caplog
...
@@ -874,8 +874,7 @@ def test_detect_circular_dependency(crawler_mocked_identifiable_retrieve, caplog
circle
=
Crawler
.
detect_circular_dependency
(
flat
)
circle
=
Crawler
.
detect_circular_dependency
(
flat
)
assert
[
id
(
el
)
for
el
in
circle
]
==
[
id
(
el
)
for
el
in
[
a
,
c
,
b
,
a
]]
assert
[
id
(
el
)
for
el
in
circle
]
==
[
id
(
el
)
for
el
in
[
a
,
c
,
b
,
a
]]
with
raises
(
Exception
):
assert
detect_circular_dependency
([
d
])
is
None
detect_circular_dependency
([
d
])
with
raises
(
RuntimeError
):
with
raises
(
RuntimeError
):
_
,
_
=
crawler
.
split_into_inserts_and_updates
(
flat
)
_
,
_
=
crawler
.
split_into_inserts_and_updates
(
flat
)
caplog
.
set_level
(
logging
.
ERROR
,
logger
=
"
caoscrawler.converters
"
)
caplog
.
set_level
(
logging
.
ERROR
,
logger
=
"
caoscrawler.converters
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment