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
bc8df463
Commit
bc8df463
authored
3 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
up
parent
bda2ff4b
No related branches found
No related tags found
1 merge request
!7
Treat dependencies among identifiables
Pipeline
#9731
failed
3 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
src/caosadvancedtools/crawler.py
+21
-12
21 additions, 12 deletions
src/caosadvancedtools/crawler.py
with
24 additions
and
12 deletions
CHANGELOG.md
+
3
−
0
View file @
bc8df463
...
...
@@ -30,6 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ###
-
identifiables of single CFoods are now treated one after the other. This
allows them to have dependencies among each other if they are ordered
correctly
-
identifiables must have at least one property or a name
*
`caosadvancedtools.serverside.helper.init_data_model`
also checks the role
and data type of entities.
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/crawler.py
+
21
−
12
View file @
bc8df463
...
...
@@ -576,6 +576,9 @@ carefully and if the changes are ok, click on the following link:
# looking for matching entities in CaosDB when there is no valid id
# i.e. there was none set from a cache
existing
=
[]
inserted
=
[]
for
ent
in
identifiables
:
if
ent
.
id
is
None
or
ent
.
id
<
0
:
logger
.
debug
(
"
Looking for: {}
"
.
format
(
...
...
@@ -593,25 +596,31 @@ carefully and if the changes are ok, click on the following link:
ent
.
id
=
None
else
:
missing
=
None
existing
.
append
(
ent
)
if
missing
:
#info = "Going to insert the following entities:\n"
# 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:
# logger.info(
# "Inserting {} Records...".format(
# len(missing_identifiables)))
try
:
guard
.
safe_insert
(
missing
,
unique
=
False
,
flags
=
{
"
force-missing-obligatory
"
:
"
ignore
"
})
inserted
.
append
(
ent
)
except
Exception
as
e
:
DataModelProblems
.
evaluate_exception
(
e
)
if
len
(
existing
)
>
0
:
info
=
"
Identified the following existing entities:
\n
"
for
ent
in
existing
:
info
+=
str
(
ent
)
+
"
\n
"
logger
.
debug
(
info
)
else
:
logger
.
debug
(
"
Did not identify any existing entities
"
)
if
len
(
inserted
)
>
0
:
info
=
"
Inserted the following entities:
\n
"
for
ent
in
inserted
:
info
+=
str
(
ent
)
+
"
\n
"
logger
.
debug
(
info
)
else
:
logger
.
debug
(
"
Did not insert any new entities
"
)
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