Skip to content

Commit

Permalink
chore: fix invalid escape sequences by applying W605 rule (#4851)
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 authored Jun 2, 2024
1 parent 2349888 commit b234710
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions api/core/splitter/text_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def get_separators_for_language(language: Language) -> list[str]:
# Split along section titles
"\n=+\n",
"\n-+\n",
"\n\*+\n",
"\n\\*+\n",
# Split along directive markers
"\n\n.. *\n\n",
# Split by the normal type of lines
Expand Down Expand Up @@ -800,7 +800,7 @@ def get_separators_for_language(language: Language) -> list[str]:
# End of code block
"```\n",
# Horizontal lines
"\n\*\*\*+\n",
"\n\\*\\*\\*+\n",
"\n---+\n",
"\n___+\n",
# Note that this splitter doesn't handle horizontal lines defined
Expand All @@ -813,10 +813,10 @@ def get_separators_for_language(language: Language) -> list[str]:
elif language == Language.LATEX:
return [
# First, try to split along Latex sections
"\n\\\chapter{",
"\n\\\section{",
"\n\\\subsection{",
"\n\\\subsubsection{",
"\n\\\\chapter{",
"\n\\\\section{",
"\n\\\\subsection{",
"\n\\\\subsubsection{",
# Now split by environments
"\n\\\begin{enumerate}",
"\n\\\begin{itemize}",
Expand Down
1 change: 1 addition & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ select = [
"UP", # pyupgrade rules
"RUF019", # unnecessary-key-check
"S506", # unsafe-yaml-load
"W605", # invalid-escape-sequence
]
ignore = [
"F403", # undefined-local-with-import-star
Expand Down
2 changes: 1 addition & 1 deletion api/services/workflow/workflow_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _convert_to_http_request_node(self, app_model: App,
}

request_body_json = json.dumps(request_body)
request_body_json = request_body_json.replace('\{\{', '{{').replace('\}\}', '}}')
request_body_json = request_body_json.replace(r'\{\{', '{{').replace(r'\}\}', '}}')

http_request_node = {
"id": f"http_request_{index}",
Expand Down

0 comments on commit b234710

Please sign in to comment.