From c4fc4ec6d059cef205cbd34827af523d88358827 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Sun, 21 Jul 2024 01:11:39 +0330 Subject: [PATCH] chore: typos fixed loookup -> lookup indentity -> identity travelled -> traveled depraction -> deprecation orignal -> original exceptionsm -> exceptions --- django/db/backends/mysql/operations.py | 2 +- django/db/backends/oracle/operations.py | 2 +- django/db/backends/postgresql/schema.py | 4 ++-- django/db/models/sql/datastructures.py | 6 +++--- django/middleware/gzip.py | 4 ++-- django/templatetags/tz.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py index 9741e6a985..3696857764 100644 --- a/django/db/backends/mysql/operations.py +++ b/django/db/backends/mysql/operations.py @@ -62,7 +62,7 @@ class DatabaseOperations(BaseDatabaseOperations): # EXTRACT returns 1-53 based on ISO-8601 for the week number. lookup_type = lookup_type.upper() if not self._extract_format_re.fullmatch(lookup_type): - raise ValueError(f"Invalid loookup type: {lookup_type!r}") + raise ValueError(f"Invalid lookup type: {lookup_type!r}") return f"EXTRACT({lookup_type} FROM {sql})", params def date_trunc_sql(self, lookup_type, sql, params, tzname=None): diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py index 86340bbf4a..2ed3138390 100644 --- a/django/db/backends/oracle/operations.py +++ b/django/db/backends/oracle/operations.py @@ -99,7 +99,7 @@ END; else: lookup_type = lookup_type.upper() if not self._extract_format_re.fullmatch(lookup_type): - raise ValueError(f"Invalid loookup type: {lookup_type!r}") + raise ValueError(f"Invalid lookup type: {lookup_type!r}") # https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/EXTRACT-datetime.html return f"EXTRACT({lookup_type} FROM {sql})", params return extract_sql, (*params, extract_param) diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py index 0c8548a5d6..86f2117bf8 100644 --- a/django/db/backends/postgresql/schema.py +++ b/django/db/backends/postgresql/schema.py @@ -51,7 +51,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): "ALTER TABLE %(table)s ALTER COLUMN %(column)s ADD " "GENERATED BY DEFAULT AS IDENTITY" ) - sql_drop_indentity = ( + sql_drop_identity = ( "ALTER TABLE %(table)s ALTER COLUMN %(column)s DROP IDENTITY IF EXISTS" ) @@ -201,7 +201,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): # Drop IDENTITY if exists (pre-Django 4.1 serial columns don't have # it). self.execute( - self.sql_drop_indentity + self.sql_drop_identity % { "table": self.quote_name(table), "column": self.quote_name(strip_quotes(new_field.column)), diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index 7c0c14a46e..c7ce36baaf 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -19,7 +19,7 @@ class MultiJoin(Exception): def __init__(self, names_pos, path_with_names): self.level = names_pos - # The path travelled, this includes the path to the multijoin. + # The path traveled, this includes the path to the multijoin. self.names_with_path = path_with_names @@ -96,12 +96,12 @@ class Join: qn = compiler.quote_name_unless_alias qn2 = connection.ops.quote_name # Add a join condition for each pair of joining columns. - # RemovedInDjango60Warning: when the depraction ends, replace with: + # RemovedInDjango60Warning: when the deprecation ends, replace with: # for lhs, rhs in self.join_field: join_fields = self.join_fields or self.join_cols for lhs, rhs in join_fields: if isinstance(lhs, str): - # RemovedInDjango60Warning: when the depraction ends, remove + # RemovedInDjango60Warning: when the deprecation ends, remove # the branch for strings. lhs_full_name = "%s.%s" % (qn(self.parent_alias), qn2(lhs)) rhs_full_name = "%s.%s" % (qn(self.table_alias), qn2(rhs)) diff --git a/django/middleware/gzip.py b/django/middleware/gzip.py index 45be6ccb43..7ccd00ac19 100644 --- a/django/middleware/gzip.py +++ b/django/middleware/gzip.py @@ -34,10 +34,10 @@ class GZipMiddleware(MiddlewareMixin): if response.is_async: # pull to lexical scope to capture fixed reference in case # streaming_content is set again later. - orignal_iterator = response.streaming_content + original_iterator = response.streaming_content async def gzip_wrapper(): - async for chunk in orignal_iterator: + async for chunk in original_iterator: yield compress_string( chunk, max_random_bytes=self.max_random_bytes, diff --git a/django/templatetags/tz.py b/django/templatetags/tz.py index f2cee2d3fe..455cc1d409 100644 --- a/django/templatetags/tz.py +++ b/django/templatetags/tz.py @@ -53,7 +53,7 @@ def do_timezone(value, arg): if timezone.is_naive(value): default_timezone = timezone.get_default_timezone() value = timezone.make_aware(value, default_timezone) - # Filters must never raise exceptionsm, so catch everything. + # Filters must never raise exceptions, so catch everything. except Exception: return ""