Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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-pylib
Commits
4e061b4f
Commit
4e061b4f
authored
7 months ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
FIX: style and lint errors
parent
a7958e4a
No related branches found
No related tags found
2 merge requests
!159
Release 0.16.o
,
!155
Review filter lists and compare_entities
Pipeline
#57182
passed with warnings
7 months ago
Stage: code_style
Stage: linting
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/linkahead/apiutils.py
+1
-1
1 addition, 1 deletion
src/linkahead/apiutils.py
src/linkahead/cached.py
+1
-1
1 addition, 1 deletion
src/linkahead/cached.py
unittests/test_apiutils.py
+2
-8
2 additions, 8 deletions
unittests/test_apiutils.py
with
4 additions
and
10 deletions
src/linkahead/apiutils.py
+
1
−
1
View file @
4e061b4f
...
@@ -327,7 +327,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
...
@@ -327,7 +327,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
try
:
try
:
same
=
empty_diff
(
val0
,
val1
,
False
,
same
=
empty_diff
(
val0
,
val1
,
False
,
entity_name_id_equivalency
)
entity_name_id_equivalency
)
except
:
except
(
ValueError
,
NotImplementedError
)
:
same
=
False
same
=
False
if
same
:
if
same
:
continue
continue
...
...
This diff is collapsed.
Click to expand it.
src/linkahead/cached.py
+
1
−
1
View file @
4e061b4f
...
@@ -116,7 +116,7 @@ All additional arguments are at their default values.
...
@@ -116,7 +116,7 @@ All additional arguments are at their default values.
return
result
return
result
@
lru_cache
(
maxsize
=
DEFAULT_SIZE
)
@lru_cache
(
maxsize
=
DEFAULT_SIZE
)
def
_cached_access
(
kind
:
AccessType
,
value
:
Union
[
str
,
int
],
unique
:
bool
=
True
):
def
_cached_access
(
kind
:
AccessType
,
value
:
Union
[
str
,
int
],
unique
:
bool
=
True
):
# This is the function that is actually cached.
# This is the function that is actually cached.
# Due to the arguments, the cache has kind of separate sections for cached_query and
# Due to the arguments, the cache has kind of separate sections for cached_query and
...
...
This diff is collapsed.
Click to expand it.
unittests/test_apiutils.py
+
2
−
8
View file @
4e061b4f
...
@@ -343,14 +343,8 @@ def test_compare_entities_battery():
...
@@ -343,14 +343,8 @@ def test_compare_entities_battery():
# Order invariance
# Order invariance
t7
=
db
.
Property
(
**
prop_settings
).
add_parent
(
par1
).
add_property
(
prop1
)
t7
=
db
.
Property
(
**
prop_settings
).
add_parent
(
par1
).
add_property
(
prop1
)
t8
=
db
.
Property
(
**
alt_settings
).
add_parent
(
par3
).
add_property
(
prop3
)
t8
=
db
.
Property
(
**
alt_settings
).
add_parent
(
par3
).
add_property
(
prop3
)
try
:
diffs_0
=
compare_entities
(
t7
,
t8
),
compare_entities
(
t7
,
t8
,
True
)
diffs_0
=
compare_entities
(
t7
,
t8
),
compare_entities
(
t7
,
t8
,
True
)
diffs_1
=
compare_entities
(
t8
,
t7
)[::
-
1
],
compare_entities
(
t8
,
t7
,
True
)[::
-
1
]
except
:
diffs_0
=
None
try
:
diffs_1
=
compare_entities
(
t8
,
t7
)[::
-
1
],
compare_entities
(
t8
,
t7
,
True
)[::
-
1
]
except
:
diffs_1
=
None
assert
diffs_0
==
diffs_1
assert
diffs_0
==
diffs_1
prop_settings
=
{
"
datatype
"
:
db
.
REFERENCE
,
"
description
"
:
"
desc of prop
"
,
prop_settings
=
{
"
datatype
"
:
db
.
REFERENCE
,
"
description
"
:
"
desc of prop
"
,
"
value
"
:
db
.
Record
().
add_parent
(
par3
),
"
unit
"
:
'
°
'
}
"
value
"
:
db
.
Record
().
add_parent
(
par3
),
"
unit
"
:
'
°
'
}
...
...
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