Skip to content

Commit

Permalink
formatting for checks
Browse files Browse the repository at this point in the history
  • Loading branch information
diivi committed Jan 3, 2023
1 parent e767747 commit f99afec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions backend/editor/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ async def find_footer(response: Response, branch: str, taxonomy_name: str):
footer = list(result)
return footer[0]


@app.get("/{taxonomy_name}/{branch}/parsing_errors")
async def find_all_errors(request: Request, branch: str, taxonomy_name: str):
"""
Expand All @@ -276,6 +277,7 @@ async def find_all_errors(request: Request, branch: str, taxonomy_name: str):
result = taxonomy.get_parsing_errors()
return result


@app.get("/{taxonomy_name}/{branch}/search")
async def search_node(response: Response, branch: str, taxonomy_name: str, query: str):
taxonomy = TaxonomyGraph(branch, taxonomy_name)
Expand Down
10 changes: 7 additions & 3 deletions backend/editor/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def list_existing_projects(self):
Helper function for listing all existing projects created in Taxonomy Editor
includes number of nodes with label ERROR for each project
"""
query = f"""
query = """
MATCH (n:PROJECT)
OPTIONAL MATCH (error_node:ERRORS {{branch_name: n.branch_name, id: n.id}})
WHERE n.status = "OPEN"
Expand Down Expand Up @@ -351,10 +351,14 @@ def get_parsing_errors(self):
"""
Helper function used for getting parsing errors in the current project
"""
# During parsing of a taxonomy, all the parsing errors are stored in a separate node with the label "ERRORS"
# During parsing of a taxonomy, all the parsing errors
# are stored in a separate node with the label "ERRORS"
# This function returns all the parsing errors
query = f"""
MATCH (error_node:ERRORS {{branch_name: "{self.branch_name}", id: "{self.project_name}"}})
MATCH (
error_node:ERRORS
{{branch_name: "{self.branch_name}", id: "{self.project_name}"}}
)
RETURN error_node
"""
result = get_current_transaction().run(query).data()[0]["error_node"]
Expand Down

0 comments on commit f99afec

Please sign in to comment.