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
d0c7c691
Commit
d0c7c691
authored
1 year ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
DOC: comments
parent
29a0bdf3
No related branches found
No related tags found
4 merge requests
!100
WIP: Filling XLSX: Seems to be working.
,
!94
ENH: add framework for converting json schema into table templates
,
!93
Filling XLSX: Everything except multiple choice.
,
!92
ENH: xlsx template generator
Pipeline
#48098
failed
1 year 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/table_json_conversion/table_generator.py
+9
-3
9 additions, 3 deletions
...aosadvancedtools/table_json_conversion/table_generator.py
with
9 additions
and
3 deletions
src/caosadvancedtools/table_json_conversion/table_generator.py
+
9
−
3
View file @
d0c7c691
...
...
@@ -145,6 +145,11 @@ class TableTemplateGenerator(ABC):
"""
recursively transforms elements from the schema into column definitions
sheets is modified in place.
Parameters
----------
array_paths: list
a list of path along the way to the current object, where the json contains arrays
Returns
-------
...
...
@@ -156,6 +161,8 @@ class TableTemplateGenerator(ABC):
f
"'
type
'
key:
\n
{
schema
}
\n
"
)
if
array_paths
is
None
:
# if this is not set, we are at top level and the top level element may always be an
# array
array_paths
=
[
path
]
ctype
=
ColumnType
.
SCALAR
...
...
@@ -168,12 +175,11 @@ class TableTemplateGenerator(ABC):
sheetname
=
"
.
"
.
join
(
path
)
sheets
[
sheetname
]
=
self
.
_treat_schema_element
(
schema
[
'
items
'
],
sheets
,
path
,
foreign_keys
,
len
(
path
),
array_paths
=
array_paths
+
[
path
]
)
print
(
"
Sel
"
,
path
)
array_paths
=
array_paths
+
[
path
]
# since this level is an array, we extend the list
)
for
p
in
array_paths
:
keys
=
self
.
_get_foreign_keys
(
foreign_keys
,
p
)
for
k
in
keys
:
print
(
k
,
p
)
sheets
[
sheetname
].
update
({
k
:
(
ColumnType
.
FOREIGN
,
f
"
see sheet
'
{
path
[
0
]
}
'"
,
p
+
[
k
])})
# columns are added to the new sheet, thus we do not return columns
return
{}
...
...
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