From 52c82157554d3bd455cf1cac47c5ee8c8fe32444 Mon Sep 17 00:00:00 2001 From: aplatkouski <5857672+aplatkouski@users.noreply.github.com> Date: Thu, 11 Jun 2020 17:16:41 +0300 Subject: [PATCH] Fix misprints in documentation and comments Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com> --- doc/build/changelog/changelog_12.rst | 2 +- doc/build/changelog/changelog_13.rst | 4 +- doc/build/changelog/unreleased_13/5198.rst | 2 +- doc/build/changelog/unreleased_13/5359.rst | 2 +- doc/build/changelog/unreleased_14/4449.rst | 2 +- .../unreleased_14/4617_implicit_subquery.rst | 2 +- doc/build/changelog/unreleased_14/4638.rst | 2 +- doc/build/changelog/unreleased_14/4643.rst | 2 +- doc/build/changelog/unreleased_14/4662.rst | 2 +- doc/build/changelog/unreleased_14/4976.rst | 2 +- doc/build/changelog/unreleased_14/5221.rst | 4 +- doc/build/core/constraints.rst | 2 +- doc/build/core/ddl.rst | 2 +- doc/build/glossary.rst | 4 +- doc/build/orm/backref.rst | 4 +- doc/build/orm/inheritance_loading.rst | 2 +- doc/build/orm/nonstandard_mappings.rst | 2 +- doc/build/orm/session_transaction.rst | 2 +- lib/sqlalchemy/dialects/mssql/provision.py | 2 +- lib/sqlalchemy/dialects/oracle/cx_oracle.py | 2 +- lib/sqlalchemy/engine/base.py | 2 +- lib/sqlalchemy/engine/cursor.py | 6 +- lib/sqlalchemy/engine/default.py | 2 +- lib/sqlalchemy/engine/reflection.py | 2 +- lib/sqlalchemy/event/api.py | 4 +- lib/sqlalchemy/future/engine.py | 4 +- lib/sqlalchemy/future/selectable.py | 4 +- lib/sqlalchemy/orm/context.py | 12 +-- lib/sqlalchemy/orm/dynamic.py | 2 +- lib/sqlalchemy/orm/instrumentation.py | 4 +- lib/sqlalchemy/orm/loading.py | 4 +- lib/sqlalchemy/orm/mapper.py | 2 +- lib/sqlalchemy/orm/session.py | 2 +- test/base/test_result.py | 4 +- test/ext/test_automap.py | 4 +- test/orm/test_assorted_eager.py | 2 +- test/orm/test_bind.py | 2 +- test/orm/test_deprecations.py | 6 +- test/sql/test_compare.py | 2 +- test/sql/test_deprecations.py | 80 +++++++++---------- 40 files changed, 99 insertions(+), 99 deletions(-) diff --git a/doc/build/changelog/changelog_12.rst b/doc/build/changelog/changelog_12.rst index 8c138bde8f..38f6fd5fa5 100644 --- a/doc/build/changelog/changelog_12.rst +++ b/doc/build/changelog/changelog_12.rst @@ -740,7 +740,7 @@ Fixed bug in cache key generation for baked queries which could cause a too-short cache key to be generated for the case of eager loads across subclasses. This could in turn cause the eagerload query to be cached in - place of a non-eagerload query, or vice versa, for a polymorhic "selectin" + place of a non-eagerload query, or vice versa, for a polymorphic "selectin" load, or possibly for lazy loads or selectin loads as well. .. change:: diff --git a/doc/build/changelog/changelog_13.rst b/doc/build/changelog/changelog_13.rst index 0b58c24c3d..50571deaaa 100644 --- a/doc/build/changelog/changelog_13.rst +++ b/doc/build/changelog/changelog_13.rst @@ -117,7 +117,7 @@ Fixed issue where an :class:`.Index` that is deferred in being associated with a table, such as as when it contains a :class:`.Column` that is not associated with any :class:`.Table` yet, would fail to attach correctly if - it also contained a non table-oriented expession. + it also contained a non table-oriented expression. .. change:: @@ -206,7 +206,7 @@ :tags: bug, mysql :tickets: 5239 - Fixed issue in MySQL dialect when connecting to a psuedo-MySQL database + Fixed issue in MySQL dialect when connecting to a pseudo-MySQL database such as that provided by ProxySQL, the up front check for isolation level when it returns no row will not prevent the dialect from continuing to connect. A warning is emitted that the isolation level could not be diff --git a/doc/build/changelog/unreleased_13/5198.rst b/doc/build/changelog/unreleased_13/5198.rst index b19da1e08e..e4bdd7a24f 100644 --- a/doc/build/changelog/unreleased_13/5198.rst +++ b/doc/build/changelog/unreleased_13/5198.rst @@ -3,6 +3,6 @@ :tickets: 5198 Added a new parameter :paramref:`_orm.query_expression.default_expr` to the - :func:`_orm.query_expression` construct, which will be appled to queries + :func:`_orm.query_expression` construct, which will be applied to queries automatically if the :func:`_orm.with_expression` option is not used. Pull request courtesy Haoyu Sun. \ No newline at end of file diff --git a/doc/build/changelog/unreleased_13/5359.rst b/doc/build/changelog/unreleased_13/5359.rst index b5f690db8d..06e5247b3e 100644 --- a/doc/build/changelog/unreleased_13/5359.rst +++ b/doc/build/changelog/unreleased_13/5359.rst @@ -4,5 +4,5 @@ Fixed an issue where the ``is_disconnect`` function in the SQL Server pyodbc dialect was incorrectly reporting the disconnect state when the - exception messsage had a substring that matched a SQL Server ODBC error + exception message had a substring that matched a SQL Server ODBC error code. \ No newline at end of file diff --git a/doc/build/changelog/unreleased_14/4449.rst b/doc/build/changelog/unreleased_14/4449.rst index f010bf47f9..8b9c4a3239 100644 --- a/doc/build/changelog/unreleased_14/4449.rst +++ b/doc/build/changelog/unreleased_14/4449.rst @@ -5,7 +5,7 @@ Additional logic has been added such that certain SQL expressions which typically wrap a single database column will use the name of that column as their "anonymous label" name within a SELECT statement, potentially making - key-based lookups in result tuples more intutive. The primary example of + key-based lookups in result tuples more intuitive. The primary example of this is that of a CAST expression, e.g. ``CAST(table.colname AS INTEGER)``, which will export its default name as "colname", rather than the usual "anon_1" label, that is, ``CAST(table.colname AS INTEGER) AS colname``. diff --git a/doc/build/changelog/unreleased_14/4617_implicit_subquery.rst b/doc/build/changelog/unreleased_14/4617_implicit_subquery.rst index a8bfad1383..6bce7e213d 100644 --- a/doc/build/changelog/unreleased_14/4617_implicit_subquery.rst +++ b/doc/build/changelog/unreleased_14/4617_implicit_subquery.rst @@ -45,7 +45,7 @@ :class:`_expression.SelectBase` (which is what's produced by :func:`_expression.select`) or :class:`_query.Query` object is passed directly to these functions and others, the ORM is typically coercing them to be a subquery by calling the - :meth:`_expression.SelectBase.alias` method automatically (which is now superceded by + :meth:`_expression.SelectBase.alias` method automatically (which is now superseded by the :meth:`_expression.SelectBase.subquery` method). See the migration notes linked below for further details. diff --git a/doc/build/changelog/unreleased_14/4638.rst b/doc/build/changelog/unreleased_14/4638.rst index 1a799cf91f..cc1cd5dd6e 100644 --- a/doc/build/changelog/unreleased_14/4638.rst +++ b/doc/build/changelog/unreleased_14/4638.rst @@ -4,6 +4,6 @@ All long-deprecated "extension" classes have been removed, including MapperExtension, SessionExtension, PoolListener, ConnectionProxy, - AttributExtension. These classes have been deprecated since version 0.7 + AttributeExtension. These classes have been deprecated since version 0.7 long superseded by the event listener system. diff --git a/doc/build/changelog/unreleased_14/4643.rst b/doc/build/changelog/unreleased_14/4643.rst index 50ad1edccb..8910c2559b 100644 --- a/doc/build/changelog/unreleased_14/4643.rst +++ b/doc/build/changelog/unreleased_14/4643.rst @@ -25,7 +25,7 @@ :tags: change, mysql :tickets: 4643 - Remove deprecated dialect ``mysql+gaerdbms`` that has beed deprecated + Remove deprecated dialect ``mysql+gaerdbms`` that has been deprecated since version 1.0. Use the MySQLdb dialect directly. Remove deprecated parameter ``quoting`` from :class:`.mysql.ENUM` diff --git a/doc/build/changelog/unreleased_14/4662.rst b/doc/build/changelog/unreleased_14/4662.rst index b297c9405e..99469e8881 100644 --- a/doc/build/changelog/unreleased_14/4662.rst +++ b/doc/build/changelog/unreleased_14/4662.rst @@ -7,7 +7,7 @@ rather than throw a :class:`.FlushError`. The rationale is so that the flush will proceed and raise a :class:`.IntegrityError` instead, in the same way as if the existing object were not present in the identity map - already. This helps with schemes that are uinsg the + already. This helps with schemes that are using the :class:`.IntegrityError` as a means of catching whether or not a row already exists in the table. diff --git a/doc/build/changelog/unreleased_14/4976.rst b/doc/build/changelog/unreleased_14/4976.rst index 2bba598969..520e6b7f03 100644 --- a/doc/build/changelog/unreleased_14/4976.rst +++ b/doc/build/changelog/unreleased_14/4976.rst @@ -5,7 +5,7 @@ Added support for use of the :class:`.Sequence` construct with MariaDB 10.3 and greater, as this is now supported by this database. The construct integrates with the :class:`_schema.Table` object in the same way that it does for - other databases like PostrgreSQL and Oracle; if is present on the integer + other databases like PostgreSQL and Oracle; if is present on the integer primary key "autoincrement" column, it is used to generate defaults. For backwards compatibility, to support a :class:`_schema.Table` that has a :class:`.Sequence` on it to support sequence only databases like Oracle, diff --git a/doc/build/changelog/unreleased_14/5221.rst b/doc/build/changelog/unreleased_14/5221.rst index 883f0029df..869c58942c 100644 --- a/doc/build/changelog/unreleased_14/5221.rst +++ b/doc/build/changelog/unreleased_14/5221.rst @@ -6,8 +6,8 @@ :func:`_expression.select` construct such that when a select statement is used in a subquery, repeated column names from different tables are now automatically labeled with a unique label name, without the need to use the - full "apply_labels()" feature that conbines tablename plus column name. - The disambigated labels are available as plain string keys in the .c + full "apply_labels()" feature that combines tablename plus column name. + The disambiguated labels are available as plain string keys in the .c collection of the subquery, and most importantly the feature allows an ORM :func:`_orm.aliased` construct against the combination of an entity and an arbitrary subquery to work correctly, targeting the correct columns despite diff --git a/doc/build/core/constraints.rst b/doc/build/core/constraints.rst index 4abe7709d7..3e1eaabad4 100644 --- a/doc/build/core/constraints.rst +++ b/doc/build/core/constraints.rst @@ -249,7 +249,7 @@ like the following is generated:: .. versionchanged:: 1.0.0 - The DDL system invoked by :meth:`_schema.MetaData.create_all` and :meth:`_schema.MetaData.drop_all` will now automatically resolve mutually - depdendent foreign keys between tables declared by + dependent foreign keys between tables declared by :class:`_schema.ForeignKeyConstraint` and :class:`_schema.ForeignKey` objects, without the need to explicitly set the :paramref:`_schema.ForeignKeyConstraint.use_alter` flag. diff --git a/doc/build/core/ddl.rst b/doc/build/core/ddl.rst index f38dcf849c..30619a419a 100644 --- a/doc/build/core/ddl.rst +++ b/doc/build/core/ddl.rst @@ -140,7 +140,7 @@ provide DDL expressions. For example, to produce a ``CREATE TABLE`` statement: .. sourcecode:: python+sql from sqlalchemy.schema import CreateTable - with engine.connecT() as conn: + with engine.connect() as conn: {sql} conn.execute(CreateTable(mytable)) CREATE TABLE mytable ( col1 INTEGER, diff --git a/doc/build/glossary.rst b/doc/build/glossary.rst index b982101153..31d470bdae 100644 --- a/doc/build/glossary.rst +++ b/doc/build/glossary.rst @@ -12,7 +12,7 @@ Glossary relational relational algebra - An algrebraic system developed by Edgar F. Codd that is used for + An algebraic system developed by Edgar F. Codd that is used for modelling and querying the data stored in relational databases. .. seealso:: @@ -131,7 +131,7 @@ Glossary An acronym for **Data Manipulation Language**. DML is the subset of SQL that relational databases use to *modify* the data in tables. DML typically refers to the three widely familiar statements of INSERT, - UPDATE and DELETE, otherwise known as :term:`CRUD` (acronoym for "CReate, + UPDATE and DELETE, otherwise known as :term:`CRUD` (acronym for "CReate, Update, Delete"). .. seealso:: diff --git a/doc/build/orm/backref.rst b/doc/build/orm/backref.rst index 80b395930b..65d19eb185 100644 --- a/doc/build/orm/backref.rst +++ b/doc/build/orm/backref.rst @@ -216,7 +216,7 @@ However, if we instead created a new ``Address`` object, and associated the In the above example, it is **not** as intuitive that the ``Address`` would automatically be added to the :class:`.Session`. However, the backref behavior of ``Address.user`` indicates that the ``Address`` object is also appended to -the ``User.addresses`` collection. This in turn intiates a **cascade** +the ``User.addresses`` collection. This in turn initiates a **cascade** operation which indicates that this ``Address`` should be placed into the :class:`.Session` as a :term:`pending` object. @@ -228,7 +228,7 @@ to False, as in:: class User(Base): # ... - addresses = relationship("Address", back_populates="user", cascade_backefs=False) + addresses = relationship("Address", back_populates="user", cascade_backrefs=False) See the example in :ref:`backref_cascade` for further information. diff --git a/doc/build/orm/inheritance_loading.rst b/doc/build/orm/inheritance_loading.rst index 7e5675c146..3ddff01cfb 100644 --- a/doc/build/orm/inheritance_loading.rst +++ b/doc/build/orm/inheritance_loading.rst @@ -541,7 +541,7 @@ similarly to the following: WHERE employee.id IN (?) ORDER BY employee.id (1,) -Combining "selectin" polymorhic loading with query-time +Combining "selectin" polymorphic loading with query-time :func:`_orm.with_polymorphic` usage is also possible (though this is very outer-space stuff!); assuming the above mappings had no ``polymorphic_load`` set up, we could get the same result as follows:: diff --git a/doc/build/orm/nonstandard_mappings.rst b/doc/build/orm/nonstandard_mappings.rst index 81679dd014..387a3bf906 100644 --- a/doc/build/orm/nonstandard_mappings.rst +++ b/doc/build/orm/nonstandard_mappings.rst @@ -189,7 +189,7 @@ at :ref:`relationship_aliased_class`. As far as the use case of a class that can actually be fully persisted to different tables under different scenarios, very early versions of SQLAlchemy offered a feature for this adapted from Hibernate, known -as the "entity name" feature. However, this use case became infeasable +as the "entity name" feature. However, this use case became infeasible within SQLAlchemy once the mapped class itself became the source of SQL expression construction; that is, the class' attributes themselves link directly to mapped table columns. The feature was removed and replaced diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst index 233768f42b..06139e0c55 100644 --- a/doc/build/orm/session_transaction.rst +++ b/doc/build/orm/session_transaction.rst @@ -403,7 +403,7 @@ has multiple binds or some other custom scheme for :meth:`.Session.get_bind`, we can pass additional arguments to :meth:`.Session.connection` in order to affect how the bind is procured:: - sess = my_sesssionmaker() + sess = my_sessionmaker() # set up a transaction for the bind associated with # the User mapper diff --git a/lib/sqlalchemy/dialects/mssql/provision.py b/lib/sqlalchemy/dialects/mssql/provision.py index 84b9e4194f..23c841da63 100644 --- a/lib/sqlalchemy/dialects/mssql/provision.py +++ b/lib/sqlalchemy/dialects/mssql/provision.py @@ -40,7 +40,7 @@ def _mssql_drop_ignore(conn, ident): # for row in conn.exec_driver_sql( # "select session_id from sys.dm_exec_sessions " # "where database_id=db_id('%s')" % ident): - # log.info("killing SQL server sesssion %s", row['session_id']) + # log.info("killing SQL server session %s", row['session_id']) # conn.exec_driver_sql("kill %s" % row['session_id']) conn.exec_driver_sql("drop database %s" % ident) diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index 4aae059dd7..651a6e6736 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -100,7 +100,7 @@ Unicode As is the case for all DBAPIs under Python 3, all strings are inherently Unicode strings. Under Python 2, cx_Oracle also supports Python Unicode -objects directly. In all cases however, the driver requires an explcit +objects directly. In all cases however, the driver requires an explicit encoding configuration. Ensuring the Correct Client Encoding diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 81c0c9f580..ffd3724625 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1944,7 +1944,7 @@ class Transaction(object): "deactive", however leave this transaction object in place as far as the connection's state. - for a "real" transaction this should roll back the transction + for a "real" transaction this should roll back the transaction and ensure this transaction is no longer a reset agent. this is used for nesting of marker transactions where the marker diff --git a/lib/sqlalchemy/engine/cursor.py b/lib/sqlalchemy/engine/cursor.py index abffe0d1f1..3c672020bd 100644 --- a/lib/sqlalchemy/engine/cursor.py +++ b/lib/sqlalchemy/engine/cursor.py @@ -720,7 +720,7 @@ class LegacyCursorResultMetaData(CursorResultMetaData): if result is not None: if result[MD_OBJECTS] is _UNPICKLED: util.warn_deprecated( - "Retreiving row values using Column objects from a " + "Retrieving row values using Column objects from a " "row that was unpickled is deprecated; adequate " "state cannot be pickled for this to be efficient. " "This usage will raise KeyError in a future release.", @@ -728,7 +728,7 @@ class LegacyCursorResultMetaData(CursorResultMetaData): ) else: util.warn_deprecated( - "Retreiving row values using Column objects with only " + "Retrieving row values using Column objects with only " "matching names as keys is deprecated, and will raise " "KeyError in a future release; only Column " "objects that are explicitly part of the statement " @@ -802,7 +802,7 @@ class ResultFetchStrategy(object): class NoCursorFetchStrategy(ResultFetchStrategy): """Cursor strategy for a result that has no open cursor. - There are two varities of this strategy, one for DQL and one for + There are two varieties of this strategy, one for DQL and one for DML (and also DDL), each of which represent a result that had a cursor but no longer has one. diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 4d516e97c5..bbb767290e 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -293,7 +293,7 @@ class DefaultDialect(interfaces.Dialect): """True if this dialect supports sane rowcount even if RETURNING is in use. - For dialects that don't support RETURNING, this is synomous + For dialects that don't support RETURNING, this is synonym with supports_sane_rowcount. """ diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index 344d5511d1..564a82c5a8 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -433,7 +433,7 @@ class Inspector(object): * ``autoincrement`` - indicates that the column is auto incremented - this is returned as a boolean or 'auto' - * ``comment`` - (optional) the commnet on the column. Only some + * ``comment`` - (optional) the comment on the column. Only some dialects return this key * ``computed`` - (optional) when present it indicates that this column diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py index 9cff670335..6bd63ceca6 100644 --- a/lib/sqlalchemy/event/api.py +++ b/lib/sqlalchemy/event/api.py @@ -67,7 +67,7 @@ def listen(target, identifier, fn, *args, **kw): .. warning:: The ``once`` argument does not imply automatic de-registration of the listener function after it has been invoked a first time; a listener entry will remain associated with the target object. - Associating an arbitrarily high number of listeners without explictitly + Associating an arbitrarily high number of listeners without explicitly removing them will cause memory to grow unbounded even if ``once=True`` is specified. @@ -134,7 +134,7 @@ def listens_for(target, identifier, *args, **kw): .. warning:: The ``once`` argument does not imply automatic de-registration of the listener function after it has been invoked a first time; a listener entry will remain associated with the target object. - Associating an arbitrarily high number of listeners without explictitly + Associating an arbitrarily high number of listeners without explicitly removing them will cause memory to grow unbounded even if ``once=True`` is specified. diff --git a/lib/sqlalchemy/future/engine.py b/lib/sqlalchemy/future/engine.py index d3b13b5107..d5922daa32 100644 --- a/lib/sqlalchemy/future/engine.py +++ b/lib/sqlalchemy/future/engine.py @@ -267,7 +267,7 @@ class Connection(_LegacyConnection): * :class:`_schema.DDL` and objects which inherit from :class:`_schema.DDLElement` - :param parameters: parameters which will be bound into the statment. + :param parameters: parameters which will be bound into the statement. This may be either a dictionary of parameter names to values, or a mutable sequence (e.g. a list) of dictionaries. When a list of dictionaries is passed, the underlying statement execution @@ -343,7 +343,7 @@ class Engine(_LegacyEngine): # they aren't calling "engine.begin()" explicitly, however, DDL # may be a special case for which we want to continue doing it this # way. A big win here is that the full DDL sequence is inside of a - # single transaction rather than COMMIT for each statment. + # single transaction rather than COMMIT for each statement. with self.begin() as conn: conn._run_ddl_visitor(visitorcallable, element, **kwargs) diff --git a/lib/sqlalchemy/future/selectable.py b/lib/sqlalchemy/future/selectable.py index ce609e7db7..473242bf83 100644 --- a/lib/sqlalchemy/future/selectable.py +++ b/lib/sqlalchemy/future/selectable.py @@ -114,7 +114,7 @@ class Select(_LegacySelect): @_generative def join(self, target, onclause=None, isouter=False, full=False): - r"""Create a SQL JOIN against this :class:`_expresson.Select` + r"""Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. @@ -132,7 +132,7 @@ class Select(_LegacySelect): def join_from( self, from_, target, onclause=None, isouter=False, full=False ): - r"""Create a SQL JOIN against this :class:`_expresson.Select` + r"""Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py index 588b835714..fe3afae349 100644 --- a/lib/sqlalchemy/orm/context.py +++ b/lib/sqlalchemy/orm/context.py @@ -783,7 +783,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState): if self.order_by: # the default coercion for ORDER BY is now the OrderByRole, # which adds an additional post coercion to ByOfRole in that - # elements are converted into label refernences. For the + # elements are converted into label references. For the # eager load / subquery wrapping case, we need to un-coerce # the original expressions outside of the label references # in order to have them render. @@ -1412,7 +1412,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState): "from, there are multiple FROMS which can " "join to this entity. Please use the .select_from() " "method to establish an explicit left side, as well as " - "providing an explcit ON clause if not present already to " + "providing an explicit ON clause if not present already to " "help resolve the ambiguity." ) else: @@ -1420,7 +1420,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState): "Don't know how to join to %r. " "Please use the .select_from() " "method to establish an explicit left side, as well as " - "providing an explcit ON clause if not present already to " + "providing an explicit ON clause if not present already to " "help resolve the ambiguity." % (right,) ) @@ -1458,7 +1458,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState): "from, there are multiple FROMS which can " "join to this entity. Please use the .select_from() " "method to establish an explicit left side, as well as " - "providing an explcit ON clause if not present already to " + "providing an explicit ON clause if not present already to " "help resolve the ambiguity." ) else: @@ -1466,7 +1466,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState): "Don't know how to join to %r. " "Please use the .select_from() " "method to establish an explicit left side, as well as " - "providing an explcit ON clause if not present already to " + "providing an explicit ON clause if not present already to " "help resolve the ambiguity." % (right,) ) else: @@ -2450,7 +2450,7 @@ class _ORMColumnEntity(_ColumnEntity): column = column._deannotate() # use entity_zero as the from if we have it. this is necessary - # for polymorpic scenarios where our FROM is based on ORM entity, + # for polymorphic scenarios where our FROM is based on ORM entity, # not the FROM of the column. but also, don't use it if our column # doesn't actually have any FROMs that line up, such as when its # a scalar subquery. diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py index adc976e32b..d15127563e 100644 --- a/lib/sqlalchemy/orm/dynamic.py +++ b/lib/sqlalchemy/orm/dynamic.py @@ -274,7 +274,7 @@ class AppenderMixin(object): # this is a hack right now. The Query only knows how to # make subsequent joins() without a given left-hand side # from self._from_obj[0]. We need to ensure prop.secondary - # is in the FROM. So we purposly put the mapper selectable + # is in the FROM. So we purposely put the mapper selectable # in _from_obj[0] to ensure a user-defined join() later on # doesn't fail, and secondary is then in _from_obj[1]. self._from_obj = (prop.mapper.selectable, prop.secondary) diff --git a/lib/sqlalchemy/orm/instrumentation.py b/lib/sqlalchemy/orm/instrumentation.py index e2f0c6a288..43e3801018 100644 --- a/lib/sqlalchemy/orm/instrumentation.py +++ b/lib/sqlalchemy/orm/instrumentation.py @@ -229,7 +229,7 @@ class ClassManager(HasMemoized, dict): setattr(self.class_, self.MANAGER_ATTR, self) def dispose(self): - """Dissasociate this manager from its class.""" + """Disassociate this manager from its class.""" delattr(self.class_, self.MANAGER_ATTR) @@ -493,7 +493,7 @@ class InstrumentationFactory(object): # this attribute is replaced by sqlalchemy.ext.instrumentation -# when importred. +# when imported. _instrumentation_factory = InstrumentationFactory() # these attributes are replaced by sqlalchemy.ext.instrumentation diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py index a33e1b77d5..abb8ce32d1 100644 --- a/lib/sqlalchemy/orm/loading.py +++ b/lib/sqlalchemy/orm/loading.py @@ -657,7 +657,7 @@ def _instance_processor( cached_populators, ) else: - # loader strategries like subqueryload, selectinload, + # loader strategies like subqueryload, selectinload, # joinedload, basically relationships, these need to interact # with the context each time to work correctly. todo.append(prop) @@ -1249,7 +1249,7 @@ def load_scalar_attributes(mapper, state, attribute_names, passive): # concrete inheritance, the class manager might have some keys # of attributes on the superclass that we didn't actually map. # These could be mapped as "concrete, dont load" or could be completely - # exluded from the mapping and we know nothing about them. Filter them + # excluded from the mapping and we know nothing about them. Filter them # here to prevent them from coming through. if attribute_names: attribute_names = attribute_names.intersection(mapper.attrs.keys()) diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index a4501a1e4b..d86b76111c 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -324,7 +324,7 @@ class Mapper( that specify ``delete-orphan`` cascade. This behavior is more consistent with that of a persistent object, and allows behavior to be consistent in more scenarios independently of whether or not an - orphanable object has been flushed yet or not. + orphan object has been flushed yet or not. See the change note and example at :ref:`legacy_is_orphan_addition` for more detail on this change. diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 6a40926da8..2058cf718a 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -207,7 +207,7 @@ class ORMExecuteState(util.MemoizedSlots): def is_orm_statement(self): """return True if the operation is an ORM statement. - This indictes that the select(), update(), or delete() being + This indicates that the select(), update(), or delete() being invoked contains ORM entities as subjects. For a statement that does not have ORM entities and instead refers only to :class:`.Table` metadata, it is invoked as a Core SQL statement diff --git a/test/base/test_result.py b/test/base/test_result.py index ce0e7b9452..bacf09d39d 100644 --- a/test/base/test_result.py +++ b/test/base/test_result.py @@ -427,7 +427,7 @@ class ResultTest(fixtures.TestBase): eq_(result.all(), []) def test_one_unique(self): - # assert that one() counts rows after uniquness has been applied. + # assert that one() counts rows after uniqueness has been applied. # this would raise if we didnt have unique result = self._fixture(data=[(1, 1, 1), (1, 1, 1)]) @@ -444,7 +444,7 @@ class ResultTest(fixtures.TestBase): assert_raises(exc.MultipleResultsFound, result.unique().one) def test_one_unique_mapping(self): - # assert that one() counts rows after uniquness has been applied. + # assert that one() counts rows after uniqueness has been applied. # this would raise if we didnt have unique result = self._fixture(data=[(1, 1, 1), (1, 1, 1)]) diff --git a/test/ext/test_automap.py b/test/ext/test_automap.py index 25c43f1730..b022f0357d 100644 --- a/test/ext/test_automap.py +++ b/test/ext/test_automap.py @@ -107,8 +107,8 @@ class AutomapTest(fixtures.MappedTest): """ The underlying reflect call accepts an optional schema argument. This is for determining which database schema to load. - This test verifies that prepare can accept an optiona schema argument - and pass it to reflect. + This test verifies that prepare can accept an optional schema + argument and pass it to reflect. """ Base = automap_base(metadata=self.metadata) engine_mock = Mock() diff --git a/test/orm/test_assorted_eager.py b/test/orm/test_assorted_eager.py index df39177122..3da69c8599 100644 --- a/test/orm/test_assorted_eager.py +++ b/test/orm/test_assorted_eager.py @@ -1,6 +1,6 @@ """Exercises for eager loading. -Derived from mailing list-reported problems and trac tickets. +Derived from mailing list-reported problems and track tickets. These are generally very old 0.1-era tests and at some point should be cleaned up and modernized. diff --git a/test/orm/test_bind.py b/test/orm/test_bind.py index 8e6d73ca44..bef06c390b 100644 --- a/test/orm/test_bind.py +++ b/test/orm/test_bind.py @@ -301,7 +301,7 @@ class BindIntegrationTest(_fixtures.FixtureTest): ), ( lambda User: future_select(1).where(User.name == "ed"), - # no mapper for this one becuase the plugin is not "orm" + # no mapper for this one because the plugin is not "orm" lambda User: {"clause": mock.ANY}, "e1", ), diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py index 2e19b94354..4e9f50661e 100644 --- a/test/orm/test_deprecations.py +++ b/test/orm/test_deprecations.py @@ -1329,7 +1329,7 @@ class InstancesTest(QueryTest, AssertsCompiledSQL): def go(): with testing.expect_deprecated( r"Using the Query.instances\(\) method without a context", - "Retreiving row values using Column objects with only " + "Retrieving row values using Column objects with only " "matching names", ): result = list( @@ -1442,7 +1442,7 @@ class InstancesTest(QueryTest, AssertsCompiledSQL): r"Using the Query.instances\(\) method without a context", r"Passing a string name for the 'alias' argument to " r"'contains_eager\(\)` is deprecated", - "Retreiving row values using Column objects with only " + "Retrieving row values using Column objects with only " "matching names", ): result = list( @@ -1512,7 +1512,7 @@ class InstancesTest(QueryTest, AssertsCompiledSQL): r"Using the Query.instances\(\) method without a context", r"Passing a string name for the 'alias' argument to " r"'contains_eager\(\)` is deprecated", - "Retreiving row values using Column objects with only " + "Retrieving row values using Column objects with only " "matching names", ): result = list( diff --git a/test/sql/test_compare.py b/test/sql/test_compare.py index 6aaafc716a..6944101346 100644 --- a/test/sql/test_compare.py +++ b/test/sql/test_compare.py @@ -609,7 +609,7 @@ class CoreFixtures(object): dont_compare_values_fixtures = [ lambda: ( - # note the in_(...) all have different column names becuase + # note the in_(...) all have different column names because # otherwise all IN expressions would compare as equivalent column("x").in_(random_choices(range(10), k=3)), column("y").in_( diff --git a/test/sql/test_deprecations.py b/test/sql/test_deprecations.py index 4f018fcc9f..7bafc64828 100644 --- a/test/sql/test_deprecations.py +++ b/test/sql/test_deprecations.py @@ -802,7 +802,7 @@ class KeyTargetingTest(fixtures.TablesTest): not_in_(bar.c.content_type, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(sql.column("content_type"), row) @@ -813,7 +813,7 @@ class KeyTargetingTest(fixtures.TablesTest): not_in_(content.c.type, row) not_in_(bar.c.content_type, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(sql.column("content_type"), row) @@ -830,12 +830,12 @@ class KeyTargetingTest(fixtures.TablesTest): row = connection.execute(stmt).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.b, row) @@ -848,12 +848,12 @@ class KeyTargetingTest(fixtures.TablesTest): row = connection.execute(stmt).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(b, row) @@ -869,33 +869,33 @@ class KeyTargetingTest(fixtures.TablesTest): row = connection.execute(stmt).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.b, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(b, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): in_(stmt.c.a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): @@ -913,23 +913,23 @@ class KeyTargetingTest(fixtures.TablesTest): row = connection.execute(stmt).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.b, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): in_(stmt.c.keyed2_a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): @@ -946,23 +946,23 @@ class KeyTargetingTest(fixtures.TablesTest): row = connection.execute(stmt).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(keyed2.c.b, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): in_(stmt.c.keyed2_a, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", "The SelectBase.c and SelectBase.columns", ): @@ -1019,7 +1019,7 @@ class CursorResultTest(fixtures.TablesTest): users = self.tables.users with testing.expect_deprecated( - # "Retreiving row values using Column objects " + # "Retrieving row values using Column objects " # "with only matching names", # "Using non-integer/slice indices on Row is " # "deprecated and will be removed in version 2.0", @@ -1036,13 +1036,13 @@ class CursorResultTest(fixtures.TablesTest): r._keymap.pop(users.c.user_id) # reset lookup with testing.expect_deprecated( - # "Retreiving row values using Column objects " + # "Retrieving row values using Column objects " # "with only matching names" ): eq_(r._mapping[users.c.user_id], 2) with testing.expect_deprecated( - # "Retreiving row values using Column objects " + # "Retrieving row values using Column objects " # "with only matching names" ): eq_(r._mapping[users.c.user_name], "jack") @@ -1053,7 +1053,7 @@ class CursorResultTest(fixtures.TablesTest): with testing.expect_deprecated( "Using non-integer/slice indices on Row is deprecated " "and will be removed in version 2.0", - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", ): r = connection.execute( @@ -1064,7 +1064,7 @@ class CursorResultTest(fixtures.TablesTest): r._keymap.pop(users.c.user_id) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): eq_(r._mapping[users.c.user_id], 2) @@ -1072,14 +1072,14 @@ class CursorResultTest(fixtures.TablesTest): with testing.expect_deprecated( "Using non-integer/slice indices on Row is deprecated " "and will be removed in version 2.0", - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names", ): eq_(r[users.c.user_name], "jack") r._keymap.pop(users.c.user_name) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): eq_(r._mapping[users.c.user_name], "jack") @@ -1095,7 +1095,7 @@ class CursorResultTest(fixtures.TablesTest): in_(content.c.type, row._mapping) not_in_(bar.c.content_type, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(sql.column("content_type"), row) @@ -1104,7 +1104,7 @@ class CursorResultTest(fixtures.TablesTest): select([content.c.type.label("content_type")]) ).first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(content.c.type, row) @@ -1112,7 +1112,7 @@ class CursorResultTest(fixtures.TablesTest): not_in_(bar.c.content_type, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(sql.column("content_type"), row) @@ -1126,7 +1126,7 @@ class CursorResultTest(fixtures.TablesTest): not_in_(bar.c.content_type, row) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): in_(sql.column("content_type"), row) @@ -1156,27 +1156,27 @@ class CursorResultTest(fixtures.TablesTest): if pickle: with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[users.c.user_id], 7) result[0]._keymap.pop(users.c.user_id) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[users.c.user_id], 7) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[users.c.user_name], "jack") result[0]._keymap.pop(users.c.user_name) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[users.c.user_name], "jack") @@ -1196,14 +1196,14 @@ class CursorResultTest(fixtures.TablesTest): # causing 'user_id' to match when use_labels wasn't # used. with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[addresses.c.user_id], 7) result[0]._keymap.pop(addresses.c.user_id) with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "from a row that was unpickled" ): eq_(result[0]._mapping[addresses.c.user_id], 7) @@ -1395,7 +1395,7 @@ class PositionalTextTest(fixtures.TablesTest): row = result.first() with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): eq_(row._mapping[text1.c.a], "a1") @@ -1420,7 +1420,7 @@ class PositionalTextTest(fixtures.TablesTest): # key fallback rules still match this to a column # unambiguously based on its name with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): eq_(row._mapping[text1.c.a], "a1") @@ -1428,7 +1428,7 @@ class PositionalTextTest(fixtures.TablesTest): # key fallback rules still match this to a column # unambiguously based on its name with testing.expect_deprecated( - "Retreiving row values using Column objects " + "Retrieving row values using Column objects " "with only matching names" ): eq_(row._mapping[text1.c.d], "d1") -- 2.47.3