Skip to content

fix typo in function name: perserve -> preserve #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions django_mongodb/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def null_if(self, compiler, connection):
return {"$cond": {"if": {"$eq": [expr1, expr2]}, "then": None, "else": expr1}}


def perserve_null(operator):
def preserve_null(operator):
# If the argument is null, the function should return null, not
# $toLower/Upper's behavior of returning an empty string.
def wrapped(self, compiler, connection):
Expand Down Expand Up @@ -201,7 +201,7 @@ def register_functions():
Left.as_mql = left
Length.as_mql = length
Log.as_mql = log
Lower.as_mql = perserve_null("toLower")
Lower.as_mql = preserve_null("toLower")
LTrim.as_mql = trim("ltrim")
Now.as_mql = now
NullIf.as_mql = null_if
Expand All @@ -212,4 +212,4 @@ def register_functions():
Substr.as_mql = substr
Trim.as_mql = trim("trim")
TruncBase.as_mql = trunc
Upper.as_mql = perserve_null("toUpper")
Upper.as_mql = preserve_null("toUpper")