Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Merge requests
!103
Something went wrong on our end
241 modify bstat
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
241 modify bstat
241-modify-bstat
into
dev
Overview
2
Commits
7
Pipelines
0
Changes
7
Closed
241 modify bstat
Cornelia Michlits
requested to merge
241-modify-bstat
into
dev
Nov 13, 2022
Overview
2
Commits
7
Pipelines
0
Changes
7
Closes #249
Edited
Dec 9, 2022
by
Martin Weise
0
0
Merge request reports
Viewing commit
d05bbd1c
Prev
Next
Show latest version
7 files
+
431
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
d05bbd1c
add ES columntypeindex, update basic statistic in analyse service
· d05bbd1c
Cornelia Michlits
authored
Nov 13, 2022
fda-analyse-service/app.py
+
17
−
2
View file @ d05bbd1c
Show full file
import
os
from
flask
import
Flask
,
request
,
Response
from
flask
import
Flask
,
request
,
Response
,
jsonify
from
determine_dt
import
determine_datatypes
from
determine_pk
import
determine_pk
import
logging
@@ -8,6 +8,7 @@ from flasgger import Swagger
from
flasgger.utils
import
swag_from
from
flasgger
import
LazyJSONEncoder
from
gevent.pywsgi
import
WSGIServer
from
basicstatistics
import
update_bstatistic
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
@@ -77,7 +78,6 @@ template = {
app
.
json_encoder
=
LazyJSONEncoder
swagger
=
Swagger
(
app
,
config
=
swagger_config
,
template
=
template
)
@app.route
(
'
/api/analyse/determinedt
'
,
methods
=
[
"
POST
"
],
endpoint
=
'
analyze_determinedt
'
)
@swag_from
(
'
as-yml/determinedt.yml
'
)
def
determinedt
():
@@ -123,6 +123,21 @@ def determinepk():
res
=
{
"
success
"
:
False
,
"
message
"
:
str
(
e
)}
return
Response
(
res
,
mimetype
=
"
application/json
"
),
500
@app.route
(
'
/api/analyse/update_mdb_col
'
,
methods
=
[
"
POST
"
],
endpoint
=
'
mdb_basicstatistic
'
)
@swag_from
(
'
/as-yml/updatecol.yml
'
)
def
mdb_basicstatistic
():
input_json
=
request
.
get_json
()
try
:
dbid
=
int
(
input_json
[
'
dbid
'
])
tid
=
int
(
input_json
[
'
tid
'
])
res
=
update_bstatistic
(
dbid
,
tid
)
logging
.
info
(
'
Update metadata database entity mdb_columns_cat, mdb_columns_num, mdb_columns_nom
'
)
return
jsonify
(
res
),
200
except
Exception
as
e
:
logging
.
error
(
e
)
res
=
{
"
success
"
:
False
,
"
message
"
:
"
Unknown error
"
}
return
jsonify
(
res
),
500
rest_server_port
=
5000
eureka_client
.
init
(
eureka_server
=
os
.
getenv
(
'
EUREKA_SERVER
'
,
'
http://localhost:9090/eureka/
'
),
Loading