Skip to content

Commit 03841d8

Browse files
linter fixes
1 parent b3755ca commit 03841d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/reference/esql-query-builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ query = (
207207

208208
ES|QL, like most query languages, is vulnerable to [code injection attacks](https://en.wikipedia.org/wiki/Code_injection) if untrusted data provided by users is added to a query. To eliminate this risk, ES|QL allows untrusted data to be given separately from the query as parameters.
209209

210-
Continuing with the example above, let's assume that the application needs a `find_employee_by_name()` function that searches for the name given as an argument. If this argument is received by the application from users, then it is considered untrusted and cannot be added to the query directly. Here is how to code the function in a secure manner:
210+
Continuing with the example above, let's assume that the application needs a `find_employee_by_name()` function that searches for the name given as an argument. If this argument is received by the application from users, then it is considered untrusted and should not be added to the query directly. Here is how to code the function in a secure manner:
211211

212212
```python
213213
def find_employee_by_name(name):

elasticsearch/esql/esql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def _format_index(index: IndexType) -> str:
117117
return index._index._name if hasattr(index, "_index") else str(index)
118118

119119
@staticmethod
120-
def _format_id(id: FieldType, allow_patterns=False) -> str:
120+
def _format_id(id: FieldType, allow_patterns: bool = False) -> str:
121121
s = str(id) # in case it is an InstrumentedField
122122
if allow_patterns and "*" in s:
123123
return s # patterns cannot be escaped
@@ -696,7 +696,7 @@ def _render_internal(self) -> str:
696696
names = (
697697
""
698698
if not self._type_name and not self._pvalue_name
699-
else f' AS {self._format_id(self._type_name) or "type"}, {self._format_id(self._pvalue_name) or "pvalue"}'
699+
else f' AS {self._format_id(self._type_name or "type")}, {self._format_id(self._pvalue_name or "pvalue")}'
700700
)
701701
return f"CHANGE_POINT {self._value}{key}{names}"
702702

0 commit comments

Comments
 (0)