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
64cb563b
Commit
64cb563b
authored
2 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Treat the specific case of type: [null, something]
parent
2640ac0e
No related branches found
No related tags found
2 merge requests
!73
MAINT: change wording of TableImporter argument and allow converters and...
,
!72
Extend json-schema model parser
Pipeline
#36029
passed
2 years ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
setup.py
+1
-1
1 addition, 1 deletion
setup.py
src/caosadvancedtools/models/parser.py
+5
-0
5 additions, 0 deletions
src/caosadvancedtools/models/parser.py
tox.ini
+0
-1
0 additions, 1 deletion
tox.ini
with
7 additions
and
3 deletions
.gitlab-ci.yml
+
1
−
1
View file @
64cb563b
...
@@ -139,7 +139,7 @@ unittest_py37:
...
@@ -139,7 +139,7 @@ unittest_py37:
stage
:
unittest
stage
:
unittest
image
:
python:3.7
image
:
python:3.7
script
:
&python_test_script
script
:
&python_test_script
-
pip install nose pandas pytest pytest-cov gitignore-parser openpyxl>=3.0.7 xlrd==1.2 h5py
jsonref
-
pip install nose pandas pytest pytest-cov gitignore-parser openpyxl>=3.0.7 xlrd==1.2 h5py
-
pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@dev
-
pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@dev
-
pip install .
-
pip install .
-
pytest --cov=caosadvancedtools unittests
-
pytest --cov=caosadvancedtools unittests
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
64cb563b
...
@@ -156,6 +156,7 @@ def setup_package():
...
@@ -156,6 +156,7 @@ def setup_package():
author_email
=
'
h.tomwoerden@indiscale.com
'
,
author_email
=
'
h.tomwoerden@indiscale.com
'
,
python_requires
=
'
>=3.7
'
,
python_requires
=
'
>=3.7
'
,
install_requires
=
[
"
caosdb>=0.11.0
"
,
install_requires
=
[
"
caosdb>=0.11.0
"
,
"
jsonref
"
,
"
jsonschema>=4.4.0
"
,
"
jsonschema>=4.4.0
"
,
"
numpy>=1.17.3
"
,
"
numpy>=1.17.3
"
,
"
openpyxl>=3.0.7
"
,
"
openpyxl>=3.0.7
"
,
...
@@ -164,7 +165,6 @@ def setup_package():
...
@@ -164,7 +165,6 @@ def setup_package():
],
],
extras_require
=
{
"
h5-crawler
"
:
[
"
h5py>=3.3.0
"
,
],
extras_require
=
{
"
h5-crawler
"
:
[
"
h5py>=3.3.0
"
,
],
"
gitignore-parser
"
:
[
"
gitignore-parser >=0.1.0
"
,
],
"
gitignore-parser
"
:
[
"
gitignore-parser >=0.1.0
"
,
],
"
jsonref
"
:
[
"
jsonref
"
,
],
},
},
packages
=
find_packages
(
'
src
'
),
packages
=
find_packages
(
'
src
'
),
package_dir
=
{
''
:
'
src
'
},
package_dir
=
{
''
:
'
src
'
},
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/models/parser.py
+
5
−
0
View file @
64cb563b
...
@@ -747,6 +747,11 @@ class JsonSchemaParser(Parser):
...
@@ -747,6 +747,11 @@ class JsonSchemaParser(Parser):
"
be identified with CaosDB
'
s name property.
"
"
be identified with CaosDB
'
s name property.
"
)
)
return
None
,
force_list
return
None
,
force_list
# LinkAhead suports null for all types, so in the very special case of
# `"type": ["null", "<other_type>"]`, only consider the other type:
if
isinstance
(
elt
[
"
type
"
],
list
)
and
len
(
elt
[
"
type
"
])
==
2
and
"
null
"
in
elt
[
"
type
"
]:
elt
[
"
type
"
].
remove
(
"
null
"
)
elt
[
"
type
"
]
=
elt
[
"
type
"
][
0
]
if
"
enum
"
in
elt
:
if
"
enum
"
in
elt
:
ent
=
self
.
_treat_enum
(
elt
,
name
)
ent
=
self
.
_treat_enum
(
elt
,
name
)
elif
elt
[
"
type
"
]
in
JSON_SCHEMA_ATOMIC_TYPES
:
elif
elt
[
"
type
"
]
in
JSON_SCHEMA_ATOMIC_TYPES
:
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
0
−
1
View file @
64cb563b
...
@@ -12,7 +12,6 @@ deps=nose
...
@@ -12,7 +12,6 @@ deps=nose
openpyxl
>=
3.0.7
openpyxl
>=
3.0.7
xlrd
=
= 1.2
xlrd
=
= 1.2
h5py
h5py
jsonref
commands
=
py.test --cov=caosadvancedtools -vv {posargs}
commands
=
py.test --cov=caosadvancedtools -vv {posargs}
[flake8]
[flake8]
...
...
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