Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
Rule Engine Service
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
brooklyn
Rule Engine Service
Commits
91403bf6
Commit
91403bf6
authored
Jan 11, 2023
by
Sarah Abrishami
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging problems
parent
7e885258
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
app/main/views/validate.py
app/main/views/validate.py
+6
-8
No files found.
app/main/views/validate.py
View file @
91403bf6
...
...
@@ -2,14 +2,13 @@ from app.main import main
from
app.main.utils.common
import
response_message
,
read_data
,
read_rules
,
write_validations
from
rulemall
import
RulesGroup
import
pandas
as
pd
from
datetime
import
datetime
@
main
.
route
(
'/validate/<dsid>/<rgid>'
,
methods
=
[
'GET'
,
'POST'
])
def
validate
(
dsid
,
rgid
):
configs
=
read_rules
(
rgid
,
where
=
'db'
)
print
(
'got rules'
)
rg
=
RulesGroup
()
rg
=
RulesGroup
(
rules
=
[]
)
rg
.
from_dict
(
configs
)
# cols = rg.get_target()
data
=
read_data
(
dsid
)
...
...
@@ -20,9 +19,8 @@ def validate(dsid, rgid):
validation
=
pd
.
concat
([
validation
.
rename
(
'validated'
),
responsible
],
axis
=
1
)
validation
=
validation
.
reset_index
()
.
rename
(
columns
=
{
'index'
:
'rid'
})
# TODO return rule group id
validation
[
'rgid'
]
=
rgid
validation
[
'dsid'
]
=
dsid
validation
[
'created_date'
]
=
datetime
.
now
()
validation
[
'modified_date'
]
=
datetime
.
now
()
result
=
write_validations
(
validation
,
where
=
'db'
)
return
response_message
(
result
)
# validation['rgid'] = rgid
# validation['dsid'] = dsid
# result = write_validations(validation, where='db')
# return response_message(result)
return
response_message
(
validation
.
to_dict
(
orient
=
'records'
))
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