Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
validata-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Validata
validata-ui
Commits
31d3acd8
Commit
31d3acd8
authored
Jun 14, 2019
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SchemaCatalog.references new behaviour and SchemaCatalog.reference_by_name
parent
9774caa5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
validata_ui/validata_util.py
validata_ui/validata_util.py
+7
-2
validata_ui/views.py
validata_ui/views.py
+3
-3
No files found.
validata_ui/validata_util.py
View file @
31d3acd8
...
...
@@ -47,11 +47,16 @@ class UploadedFileValidataResource(ValidataResource):
def
__detect_format
(
self
):
ext
=
Path
(
self
.
filename
).
suffix
import
ipdb
ipdb
.
set_trace
()
if
ext
in
(
'.csv'
,
'.tsv'
,
'.ods'
,
'.xls'
,
'.xlsx'
):
return
ext
[
1
:]
return
None
def
build_tabulator_stream_args
(
self
):
"""Uploaded file implementation"""
return
(
self
.
build_reader
(),
{
'format'
:
self
.
__detect_format
()})
options
=
{
'scheme'
:
'stream'
,
# 'format': self.__detect_format()
}
return
(
self
.
build_reader
(),
options
)
validata_ui/views.py
View file @
31d3acd8
...
...
@@ -59,7 +59,7 @@ class SchemaInstance():
schema_ref
=
parameter_dict
.
get
(
'schema_ref'
)
# Unknown schema name?
table_schema_reference
=
table_schema_catalog
.
reference
s
.
get
(
schema_name
)
table_schema_reference
=
table_schema_catalog
.
reference
_by_name
.
get
(
schema_name
)
if
table_schema_reference
is
None
:
return
None
...
...
@@ -384,10 +384,10 @@ def hydrate_ui_config(ui_config, table_schema_catalog):
hydrated_ui_config
=
ui_config
.
copy
()
table_schema_ref_list
=
[]
for
name
,
ref
in
sorted
(
table_schema_catalog
.
references
.
items
(),
key
=
itemgetter
(
0
))
:
for
ref
in
table_schema_catalog
.
references
:
table_schema
=
schema_from_url
(
ref
.
get_schema_url
())
info
=
{
"name"
:
name
,
"name"
:
ref
.
name
,
**
{
k
:
v
for
k
,
v
in
table_schema
.
descriptor
.
items
()
if
k
!=
'fields'
}
}
table_schema_ref_list
.
append
(
info
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment