]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix various lib / test / examples typos (#7017)
authorKevin Kirsche <kevin.kirsche@one.verizon.com>
Sat, 11 Sep 2021 20:26:59 +0000 (16:26 -0400)
committerGitHub <noreply@github.com>
Sat, 11 Sep 2021 20:26:59 +0000 (22:26 +0200)
* fix: lib/sqlalchemy/sql/lambdas.py

* fix: lib/sqlalchemy/sql/compiler.py

* fix: lib/sqlalchemy/sql/selectable.py

* fix: lib/sqlalchemy/orm/relationships.py

* fix: lib/sqlalchemy/dialects/mssql/base.py

* fix: lib/sql/test_compiler.py

* fix: lib/sqlalchemy/testing/requirements.py

* fix: lib/sqlalchemy/orm/path_registry.py

* fix: lib/sqlalchemy/dialects/postgresql/psycopg2.py

* fix: lib/sqlalchemy/cextension/immutabledict.c

* fix: lib/sqlalchemy/cextension/resultproxy.c

* fix: ./lib/sqlalchemy/dialects/oracle/cx_oracle.py

* fix: examples/versioned_rows/versioned_rows_w_versionid.py

* fix: examples/elementtree/optimized_al.py

* fix: test/orm/test_attribute.py

* fix: test/sql/test_compare.py

* fix: test/sql/test_type_expression.py

* fix: capitalization in test/dialect/mysql/test_compiler.py

* fix: typos in test/dialect/postgresql/test_reflection.py

* fix: typo in tox.ini comment

* fix: typo in /lib/sqlalchemy/orm/decl_api.py

* fix: typo in test/orm/test_update_delete.py

* fix: self-induced typo

* fix: typo in test/orm/test_query.py

* fix: typos in test/dialect/mssql/test_types.py

* fix: typo in test/sql/test_types.py

25 files changed:
examples/elementtree/optimized_al.py
examples/versioned_rows/versioned_rows_w_versionid.py
lib/sqlalchemy/cextension/immutabledict.c
lib/sqlalchemy/cextension/resultproxy.c
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/path_registry.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/testing/requirements.py
test/dialect/mssql/test_types.py
test/dialect/mysql/test_compiler.py
test/dialect/postgresql/test_reflection.py
test/orm/test_attributes.py
test/orm/test_query.py
test/orm/test_update_delete.py
test/sql/test_compare.py
test/sql/test_compiler.py
test/sql/test_type_expressions.py
test/sql/test_types.py
tox.ini

index 158b335fddd941cf7402cdbad4fdc62740ffc40f..74b4d279d2f672cc11ca52082ecf2138a16187c2 100644 (file)
@@ -132,7 +132,7 @@ mapper(
     properties={
         "children": relationship(
             _Node, lazy=None
-        ),  # doesnt load; used only for the save relationship
+        ),  # doesn't load; used only for the save relationship
         "attributes": relationship(
             _Attribute, lazy="joined", cascade="all, delete-orphan"
         ),  # eagerly load attributes
index 790d2ed14bdd402028a265d0e74f8c436e448b5c..ac5d0f58afa7f1b1ac6582b36e0752f9144af663 100644 (file)
@@ -3,7 +3,7 @@ an UPDATE statement on a single row into an INSERT statement, so that a new
 row is inserted with the new data, keeping the old row intact.
 
 This example adds a numerical version_id to the Versioned class as well
-as the ability to see which row is the most "current" vesion.
+as the ability to see which row is the most "current" version.
 
 """
 from sqlalchemy import Boolean
index 0b1003d631badce9e11ced427ccaac231a76b5fa..1188dcd2baf0118369122b239fe1f36297356551 100644 (file)
@@ -173,7 +173,7 @@ ImmutableDict_union(PyObject *self, PyObject *args, PyObject *kw)
     }
 
     if (!PyDict_CheckExact(arg_dict)) {
-        // if we didnt get a dict, and got lists of tuples or
+        // if we didn't get a dict, and got lists of tuples or
         // keyword args, make a dict
         arg_dict = PyObject_Call((PyObject *) &PyDict_Type, args, kw);
         if (arg_dict == NULL) {
index dc828698c08fe469a4968e524c95c9d89f4979dd..2de672f22b9b01998eafd0a837ef94955059ec8d 100644 (file)
@@ -442,7 +442,7 @@ BaseRow_subscript_impl(BaseRow *self, PyObject *key, int asmapping)
 
         // support negative indexes.   We can also call PySequence_GetItem,
         // but here we can stay with the simpler tuple protocol
-        // rather than the seqeunce protocol which has to check for
+        // rather than the sequence protocol which has to check for
         // __getitem__ methods etc.
         if (index < 0)
             index += (long)BaseRow_length(self);
@@ -467,7 +467,7 @@ BaseRow_subscript_impl(BaseRow *self, PyObject *key, int asmapping)
 
         // support negative indexes.   We can also call PySequence_GetItem,
         // but here we can stay with the simpler tuple protocol
-        // rather than the seqeunce protocol which has to check for
+        // rather than the sequence protocol which has to check for
         // __getitem__ methods etc.
         if (index < 0)
             index += (long)BaseRow_length(self);
index 8607edecada0de0b3e9116ef7364f4b9b0a61176..7946633eb5861a20e275a53d4f2d0f62498192d3 100644 (file)
@@ -514,7 +514,7 @@ or embedded dots, use two sets of brackets::
 
 
 .. versionchanged:: 1.2 the SQL Server dialect now treats brackets as
-   identifier delimeters splitting the schema into separate database
+   identifier delimiters splitting the schema into separate database
    and owner tokens, to allow dots within either name itself.
 
 .. _legacy_schema_rendering:
index 219ba82e492601afdd550079e536c121846e7565..aab2018bf92bd6639e64481c7889e797d19609f4 100644 (file)
@@ -108,7 +108,7 @@ Any cx_Oracle parameter value and/or constant may be passed, such as::
     )
 
 Note that the default value for ``encoding`` and ``nencoding`` was changed to
-"UTF-8" in cx_Oracle 8.0 so these parameters can be ommitted when using that
+"UTF-8" in cx_Oracle 8.0 so these parameters can be omitted when using that
 version, or later.
 
 Options consumed by the SQLAlchemy cx_Oracle dialect outside of the driver
index cce4ae19fd839865de8e8d4113f995571ae4d396..c80198825ed3ef8d4ca9f7112e3cbd11029cab55 100644 (file)
@@ -1037,7 +1037,7 @@ class PGDialect_psycopg2(PGDialect):
                 "connection not open",
                 "could not receive data from server",
                 "could not send data to server",
-                # psycopg2 client errors, psycopg2/conenction.h,
+                # psycopg2 client errors, psycopg2/connection.h,
                 # psycopg2/cursor.h
                 "connection already closed",
                 "cursor already closed",
index 1b35f07286b5b33d8824b53a0891c7237e21599c..94cda236d154c5487177480fa7c95ef98a88ad85 100644 (file)
@@ -126,7 +126,7 @@ class declared_attr(interfaces._MappedAttribute, property):
     :class:`_orm.declared_attr` is typically applied as a decorator to a class
     level method, turning the attribute into a scalar-like property that can be
     invoked from the uninstantiated class. The Declarative mapping process
-    looks for these :class:`_orm.declared_attr` callables as it scans classe,
+    looks for these :class:`_orm.declared_attr` callables as it scans classes,
     and assumes any attribute marked with :class:`_orm.declared_attr` will be a
     callable that will produce an object specific to the Declarative mapping or
     table configuration.
index d50a242ee83755944025dd38fd2e4e22d523f2c9..0327605d529851077815a040e181146881faa44e 100644 (file)
@@ -420,7 +420,7 @@ class AbstractEntityRegistry(PathRegistry):
                 )
         # it seems to make sense that since these paths get mixed up
         # with statements that are cached or not, we should make
-        # sure the natural path is cachable across different occurrences
+        # sure the natural path is cacheable across different occurrences
         # of equivalent AliasedClass objects.  however, so far this
         # does not seem to be needed for whatever reason.
         # elif not parent.path and self.is_aliased_class:
index b44a161022ef7d91c467c4cd6cd4a095cc7cddd0..e7999521a6c59630165d76a64c1b6d1a37fdf531 100644 (file)
@@ -3431,7 +3431,7 @@ class JoinCondition(object):
                         and pr.key not in self.prop._overlaps
                         and self.prop.key not in pr._overlaps
                         # note: the "__*" symbol is used internally by
-                        # SQLAlchemy as a general means of supressing the
+                        # SQLAlchemy as a general means of suppressing the
                         # overlaps warning for some extension cases, however
                         # this is not currently
                         # a publicly supported symbol and may change at
index 94a0b42017d19061fbafdd98765580133981322a..9af82823af078ebc7813f1b3b7559ccd5880f15f 100644 (file)
@@ -610,7 +610,7 @@ class SQLCompiler(Compiled):
     """
 
     _loose_column_name_matching = False
-    """tell the result object that the SQL staement is textual, wants to match
+    """tell the result object that the SQL statement is textual, wants to match
     up to Column objects, and may be using the ._tq_label in the SELECT rather
     than the base name.
 
index 36e470ce7c06c08c0a92e22c842c60d078d41974..03cd05f0202c796493054cbc2e1ff17af0d535d8 100644 (file)
@@ -905,7 +905,7 @@ class AnalyzedCode(object):
         util.raise_(
             exc.InvalidRequestError(
                 "Closure variable named '%s' inside of lambda callable %s "
-                "does not refer to a cachable SQL element, and also does not "
+                "does not refer to a cacheable SQL element, and also does not "
                 "appear to be serving as a SQL literal bound value based on "
                 "the default "
                 "SQL expression returned by the function.   This variable "
index e530beef29fb83081aae8553ea3b9783b5f31f15..c6d997649a4c72ac993ffe981bb1485db10bcc68 100644 (file)
@@ -809,7 +809,7 @@ class FromClause(roles.AnonymizedFromClauseRole, Selectable):
         objects maintained by this :class:`_expression.FromClause`.
 
         The :attr:`_sql.FromClause.c` attribute is an alias for the
-        :attr:`_sql.FromClause.columns` atttribute.
+        :attr:`_sql.FromClause.columns` attribute.
 
         :return: a :class:`.ColumnCollection`
 
index e6e5db774ff7882b5f2c14b7a7187d45942cba22..40127addfb4b481f616d3fe404fae3f891b5da7f 100644 (file)
@@ -500,7 +500,7 @@ class SuiteRequirements(Requirements):
     def foreign_key_constraint_name_reflection(self):
         """Target supports refleciton of FOREIGN KEY constraints and
         will return the name of the constraint that was used in the
-        "CONSTRANT <name> FOREIGN KEY" DDL.
+        "CONSTRAINT <name> FOREIGN KEY" DDL.
 
         MySQL prior to version 8 and MariaDB prior to version 10.5
         don't support this.
index 269638cd350bebab944edd2ee292c4697e8f9774..c46cf825849f70b242da60671c183ed924d080a6 100644 (file)
@@ -197,7 +197,7 @@ class RowVersionTest(fixtures.TablesTest):
         assert isinstance(insp.get_columns("ts_t")[1]["type"], TIMESTAMP)
 
     def test_class_hierarchy(self):
-        """TIMESTAMP and ROWVERSION aren't datetime types, theyre binary."""
+        """TIMESTAMP and ROWVERSION aren't datetime types, they're binary."""
 
         assert issubclass(TIMESTAMP, sqltypes._Binary)
         assert issubclass(ROWVERSION, sqltypes._Binary)
@@ -1179,7 +1179,7 @@ class StringTest(fixtures.TestBase, AssertsCompiledSQL):
         )
 
     def test_string_text_explicit_literal_binds(self):
-        # the literal experssion here coerces the right side to
+        # the literal expression here coerces the right side to
         # Unicode on Python 3 for plain string, test with unicode
         # string just to confirm literal is doing this
         self.assert_compile(
index c6c3bf99d50d8fcd1170b5e24489d198c6b8537e..169d46ed245d1f127500e7a1620c4e9a1e59e31b 100644 (file)
@@ -767,7 +767,7 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
                 "SELECT EXTRACT(%s FROM t.col1) AS anon_1 FROM t" % field,
             )
 
-        # millsecondS to millisecond
+        # milliseconds to millisecond
         self.assert_compile(
             select(extract("milliseconds", t.c.col1)),
             "SELECT EXTRACT(millisecond FROM t.col1) AS anon_1 FROM t",
index 4b6d927b37dd2e9162c9ca652d6420f2a39dd0ff..fa90ec212fcfaa03cd064aaa52df019f56eba48f 100644 (file)
@@ -997,7 +997,7 @@ class ReflectionTest(
         )
 
     def test_index_reflection_partial(self, metadata, connection):
-        """Reflect the filter defintion on partial indexes"""
+        """Reflect the filter definition on partial indexes"""
 
         metadata = metadata
 
index 3cdc9b784c255d0a5d71a66aa1474c349d8adc4c..130e9807839809e049ae40e14e37db0e01259d3d 100644 (file)
@@ -1285,7 +1285,7 @@ class BackrefTest(fixtures.ORMTest):
     def test_symmetric_o2o_inheritance(self):
         """Test that backref 'initiator' catching goes against
         a token that is global to all InstrumentedAttribute objects
-        within a particular class, not just the indvidual IA object
+        within a particular class, not just the individual IA object
         since we use distinct objects in an inheritance scenario.
 
         """
index 41fe30420cb46656e8530ac0b8e4f1cb51271419..16e5accfd31f310c96a941b87e3dfc7c21b4007d 100644 (file)
@@ -4909,7 +4909,7 @@ class DistinctTest(QueryTest, AssertsCompiledSQL):
 
         subq = q.subquery()
 
-        # note this is a bit cutting edge; two differnet entities against
+        # note this is a bit cutting edge; two different entities against
         # the same subquery.
         uentity = aliased(User, subq)
         aentity = aliased(Address, subq)
index 3890fd8bba8b0499b8c491af2efaf2a31cb25bf6..30c179ee3b1d7d8309371bd7c53eb8d7ade5c414 100644 (file)
@@ -317,7 +317,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
             if expire_jane_age:
                 asserter.assert_(
                     # it has to unexpire jane.name, because jane is not fully
-                    # expired and the critiera needs to look at this particular
+                    # expired and the critieria needs to look at this particular
                     # key
                     CompiledSQL(
                         "SELECT users.age_int AS users_age_int, "
@@ -335,7 +335,7 @@ class UpdateDeleteTest(fixtures.MappedTest):
             else:
                 asserter.assert_(
                     # it has to unexpire jane.name, because jane is not fully
-                    # expired and the critiera needs to look at this particular
+                    # expired and the critieria needs to look at this particular
                     # key
                     CompiledSQL(
                         "SELECT users.name AS users_name FROM users "
index 371e68a8ada883c56a57f054cbfb64724d9112d9..eaae0c448dc53e9358b58f56428d43fef20d67cf 100644 (file)
@@ -860,7 +860,7 @@ class CoreFixtures(object):
             subq = select(l).subquery()
 
             # this creates a ColumnClause as a proxy to the Label() that has
-            # an anoymous name, so the column has one too.
+            # an anonymous name, so the column has one too.
             anon_col = subq.c[0]
 
             # then when BindParameter is created, it checks the label
@@ -876,7 +876,7 @@ class CoreFixtures(object):
             subq = select(l).subquery()
 
             # this creates a ColumnClause as a proxy to the Label() that has
-            # an anoymous name, so the column has one too.
+            # an anonymous name, so the column has one too.
             anon_col = subq.c[0]
 
             # then when BindParameter is created, it checks the label
index b150b9f64357278624da77b5be3734ee101677d9..15b13caaa64fbc5225d310a8250face0179b5b87 100644 (file)
@@ -3682,7 +3682,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         subq = select(l).subquery()
 
         # this creates a ColumnClause as a proxy to the Label() that has
-        # an anoymous name, so the column has one too.
+        # an anonymous name, so the column has one too.
         anon_col = subq.c[0]
         assert isinstance(anon_col.name, elements._anonymous_label)
 
@@ -3896,7 +3896,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         # it's anonymous so unique=True
         is_true(original_bind.unique)
 
-        # cache key against hte original param
+        # cache key against the original param
         cache_key = stmt._generate_cache_key()
 
         # now adapt the statement
@@ -3971,7 +3971,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         # it's anonymous so unique=True
         is_true(original_bind.unique)
 
-        # cache key against hte original param
+        # cache key against the original param
         cache_key = stmt._generate_cache_key()
 
         # now adapt the statement and separately adapt the inner
@@ -5309,7 +5309,7 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL):
         for kw in ("onupdate", "ondelete", "initially"):
             for phrase in (
                 "NOT SQL",
-                "INITALLY NOT SQL",
+                "INITIALLY NOT SQL",
                 "FOO RESTRICT",
                 "CASCADE WRONG",
                 "SET  NULL",
index c4ed8121e214b67459ce17d72ae7e0d90e9d7dd1..51ee0ae62905f0e37ec6aaed9fa421a48bc9a2db 100644 (file)
@@ -24,7 +24,7 @@ class _ExprFixture(object):
     def _fixture(self):
         class MyString(String):
 
-            # supercedes any processing that might be on
+            # supersedes any processing that might be on
             # String
             def bind_expression(self, bindvalue):
                 return func.lower(bindvalue)
index 261c3ed10d28f99af693b690a86304e0ce2cf586..01266d15b8826965ae4abe808c9bb411f2faf9d4 100644 (file)
@@ -1116,7 +1116,7 @@ class TypeCoerceCastTest(fixtures.TablesTest):
         MyType = self.MyType
 
         # test coerce from nulltype - e.g. use an object that
-        # does't match to a known type
+        # doesn't match to a known type
         class MyObj(object):
             def __str__(self):
                 return "THISISMYOBJ"
diff --git a/tox.ini b/tox.ini
index 3cf11ba2e728b08f2ecb1bdc9bd6ea7dc3adbfd0..544b27491ec5855b03af4fc2c1968c85d344ccc3 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -147,7 +147,7 @@ deps=
       flake8-builtins
       flake8-docstrings>=1.3.1
       flake8-rst-docstrings
-      # flake8-rst-docstrings depdendency, leaving it here
+      # flake8-rst-docstrings dependency, leaving it here
       # in case it requires a version pin
       pydocstyle
       pygments