Skip to content

Commit 651fcc0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9b91593 commit 651fcc0

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

docs/source/reference/db.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ TaskRecord keys:
8080
MongoDB operators we emulate on all backends:
8181

8282
| Operator | Python equivalent |
83-
| -------- |-------------------------------------------------------------------------------|
83+
| -------- | ----------------------------------------------------------------------------- |
8484
| '\$in' | in |
8585
| '\$nin' | not in |
8686
| '\$eq' | == |
@@ -89,12 +89,12 @@ MongoDB operators we emulate on all backends:
8989
| '\$gte' | >= |
9090
| '\$le' | \< |
9191
| '\$lte' | \<= |
92-
| '\$glob' | [fnmatch](https://docs.python.org/3/library/fnmatch.html) (wildcard matching) |
92+
| '\$glob' | [fnmatch](https://docs.python.org/3/library/fnmatch.html) (wildcard matching) |
9393

94-
Remarks on _$glob_: The operator can be used to find substrings in DB columns based on
95-
[unix style filename pattern matching](https://docs.python.org/3/library/fnmatch.html)
96-
_$glob_ is **not** a regular MongoDB opertor, but is internally translated to a regular
97-
expression (_$regex_) which is natively supported by MongoDB.
94+
Remarks on _$glob_: The operator can be used to find substrings in DB columns based on
95+
[unix style filename pattern matching](https://docs.python.org/3/library/fnmatch.html)
96+
_$glob_ is **not** a regular MongoDB opertor, but is internally translated to a regular
97+
expression (_$regex_) which is natively supported by MongoDB.
9898

9999
The DB Query is useful for two primary cases:
100100

ipyparallel/controller/dictdb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# Distributed under the terms of the Modified BSD License.
3838
import copy
3939
import fnmatch
40-
import re
4140
from copy import deepcopy
4241
from datetime import datetime
4342

ipyparallel/controller/mongodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _translate(self, filter):
127127
)
128128
# we need to attach the start and end match character to achieve
129129
# an equivalent matching behavior to fnmatch in mongoDB
130-
ret["$regex"] = "^"+fnmatch.translate(glob)+"$"
130+
ret["$regex"] = "^" + fnmatch.translate(glob) + "$"
131131
else:
132132
for key, value in filter.items():
133133
if isinstance(value, dict):

0 commit comments

Comments
 (0)