Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
a6a36351
Commit
a6a36351
authored
3 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
trial
parent
bfa5a598
No related branches found
No related tags found
1 merge request
!7
Treat dependencies among identifiables
Pipeline
#9683
failed
3 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/crawler.py
+22
-24
22 additions, 24 deletions
src/caosadvancedtools/crawler.py
with
22 additions
and
24 deletions
src/caosadvancedtools/crawler.py
+
22
−
24
View file @
a6a36351
...
...
@@ -587,33 +587,31 @@ carefully and if the changes are ok, click on the following link:
else
:
logger
.
debug
(
"
Id is known of: {}
"
.
format
(
ent
))
# insert missing, i.e. those which are not valid
missing_identifiables
=
db
.
Container
()
missing_identifiables
.
extend
([
ent
for
ent
in
identifiables
if
ent
.
id
is
None
or
ent
.
id
<
0
])
# TODO the following should not be necessary. Fix it
for
ent
in
missing_identifiables
:
ent
.
id
=
None
# insert missing, i.e. those which are not valid
if
ent
.
id
is
None
or
ent
.
id
<
0
:
missing
=
ent
ent
.
id
=
None
else
:
missing
=
None
if
len
(
missing_identifiables
)
>
0
:
info
=
"
Going to insert the following entities:
\n
"
if
missing
:
#
info = "Going to insert the following entities:\n"
for
ent
in
missing_identifiables
:
info
+=
str
(
ent
)
+
"
\n
"
logger
.
debug
(
info
)
#
for ent in missing_identifiables:
#
info += str(ent)+"\n"
#
logger.debug(info)
if
len
(
missing_identifiables
)
==
0
:
logger
.
debug
(
"
No new entities to be inserted.
"
)
else
:
try
:
logg
er
.
in
fo
(
"
Inserting {} Records...
"
.
format
(
len
(
missing_identifiables
)))
guard
.
safe_insert
(
missing
_identifiables
,
unique
=
False
,
flags
=
{
"
force-missing-obligatory
"
:
"
ignore
"
})
except
Exception
as
e
:
DataModelProblems
.
evaluate_exception
(
e
)
#
if len(missing_identifiables) == 0:
#
logger.debug("No new entities to be inserted.")
#
else:
# logger.info(
# "Ins
er
t
in
g {} Records...".format
(
#
len(missing_identifiables)))
try
:
guard
.
safe_insert
(
[
missing
]
,
unique
=
False
,
flags
=
{
"
force-missing-obligatory
"
:
"
ignore
"
})
except
Exception
as
e
:
DataModelProblems
.
evaluate_exception
(
e
)
logger
.
debug
(
"
Retrieving entities from CaosDB...
"
)
identifiables
.
retrieve
(
unique
=
True
,
raise_exception_on_error
=
False
)
...
...
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