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
3a40e9a2
Commit
3a40e9a2
authored
2 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Use new error and reorganize imports
parent
d13fc55d
No related branches found
No related tags found
2 merge requests
!91
Release 0.3
,
!62
Fix merge conflict in split_into_inserts_and_updates
Pipeline
#30660
failed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/crawl.py
+25
-22
25 additions, 22 deletions
src/caoscrawler/crawl.py
with
25 additions
and
22 deletions
src/caoscrawler/crawl.py
+
25
−
22
View file @
3a40e9a2
...
...
@@ -29,35 +29,40 @@ the acuired data with CaosDB.
"""
from
__future__
import
annotations
import
argparse
import
importlib
from
caosadvancedtools.cache
import
UpdateCache
,
Cache
import
uuid
import
sys
import
logging
import
os
import
sys
import
uuid
import
warnings
import
yaml
from
argparse
import
RawTextHelpFormatter
from
collections
import
defaultdict
from
copy
import
deepcopy
from
enum
import
Enum
import
logging
from
importlib_resources
import
files
import
argparse
from
argparse
import
RawTextHelpFormatter
from
jsonschema
import
validate
from
typing
import
Any
,
Optional
,
Type
,
Union
import
caosdb
as
db
from
caosadvancedtools.cache
import
UpdateCache
,
Cache
from
caosadvancedtools.crawler
import
Crawler
as
OldCrawler
import
warnings
from
caosdb.apiutils
import
(
compare_entities
,
EntityMergeConflictError
,
merge_entities
)
from
caosdb.common.datatype
import
is_reference
from
.stores
import
GeneralStore
,
RecordStore
from
.identified_cache
import
IdentifiedCache
from
.structure_elements
import
StructureElement
,
Directory
from
.converters
import
Converter
,
DirectoryConverter
from
.identifiable_adapters
import
(
IdentifiableAdapter
,
LocalStorageIdentifiableAdapter
,
CaosDBIdentifiableAdapter
)
from
collections
import
defaultdict
from
typing
import
Any
,
Optional
,
Type
,
Union
from
caosdb.apiutils
import
compare_entities
,
merge_entities
from
copy
import
deepcopy
from
jsonschema
import
validate
from
.identified_cache
import
IdentifiedCache
from
.macros
import
defmacro_constructor
,
macro_constructor
from
.stores
import
GeneralStore
,
RecordStore
from
.structure_elements
import
StructureElement
,
Directory
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -744,11 +749,8 @@ class Crawler(object):
newrecord
=
self
.
get_from_any_cache
(
record
)
try
:
merge_entities
(
newrecord
,
record
)
except
RuntimeError
as
re
:
if
"
Merge conflict
"
in
str
(
re
):
except
EntityMergeConflictError
:
continue
else
:
raise
re
Crawler
.
bend_references_to_new_object
(
old
=
record
,
new
=
newrecord
,
entities
=
flat
+
to_be_updated
+
to_be_inserted
)
...
...
@@ -986,7 +988,8 @@ class Crawler(object):
if
self
.
identifiableAdapter
is
None
:
raise
RuntimeError
(
"
Should not happen.
"
)
to_be_inserted
,
to_be_updated
=
self
.
split_into_inserts_and_updates
(
crawled_data
)
to_be_inserted
,
to_be_updated
=
self
.
split_into_inserts_and_updates
(
crawled_data
)
# TODO: refactoring of typo
for
el
in
to_be_updated
:
...
...
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