[Sqlalchemy-commits] sqlalchemy: Corrected a bunch of spelling typos.
Brought to you by:
zzzeek
From: <co...@sq...> - 2011-03-14 19:25:23
|
details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/1939fcd1c90c changeset: 7405:1939fcd1c90c user: diana date: Mon Mar 14 15:22:09 2011 -0400 description: Corrected a bunch of spelling typos. Subject: sqlalchemy: Merge details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/fadc6d665b5e changeset: 7406:fadc6d665b5e user: Michael Trier <mt...@gm...> date: Mon Mar 14 15:25:07 2011 -0400 description: Merge diffstat: CHANGES | 4 ++++ lib/sqlalchemy/engine/base.py | 2 +- lib/sqlalchemy/exc.py | 4 ++-- lib/sqlalchemy/ext/declarative.py | 8 +++++--- lib/sqlalchemy/orm/attributes.py | 2 +- lib/sqlalchemy/orm/dependency.py | 2 +- lib/sqlalchemy/orm/interfaces.py | 2 +- lib/sqlalchemy/orm/properties.py | 6 +++--- lib/sqlalchemy/orm/query.py | 14 +++++++------- lib/sqlalchemy/orm/session.py | 4 ++-- lib/sqlalchemy/orm/sync.py | 2 +- lib/sqlalchemy/sql/expression.py | 2 +- lib/sqlalchemy/sql/util.py | 2 +- test/dialect/test_mysql.py | 2 +- test/engine/test_transaction.py | 2 +- test/ext/test_declarative.py | 23 ++++++++++++++++++++++- test/orm/test_expire.py | 4 ++-- test/orm/test_unitofwork.py | 4 ++-- 18 files changed, 58 insertions(+), 31 deletions(-) diffs (truncated from 357 to 300 lines): diff -r 3861c784aa8a -r fadc6d665b5e CHANGES --- a/CHANGES Sat Mar 05 12:19:40 2011 -0500 +++ b/CHANGES Mon Mar 14 15:25:07 2011 -0400 @@ -77,6 +77,10 @@ - Fix error message referencing old @classproperty name to reference @declared_attr [ticket:2061] + - Arguments in __mapper_args__ that aren't "hashable" + aren't mistaken for always-hashable, possibly-column + arguments. [ticket:2091] + 0.6.6 ===== - orm diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/engine/base.py --- a/lib/sqlalchemy/engine/base.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/engine/base.py Mon Mar 14 15:25:07 2011 -0400 @@ -617,7 +617,7 @@ raise NotImplementedError() def handle_dbapi_exception(self, e): - """Receive a DBAPI exception which occured upon execute, result + """Receive a DBAPI exception which occurred upon execute, result fetch, etc.""" raise NotImplementedError() diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/exc.py --- a/lib/sqlalchemy/exc.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/exc.py Mon Mar 14 15:25:07 2011 -0400 @@ -39,7 +39,7 @@ class IdentifierError(SQLAlchemyError): """Raised when a schema name is beyond the max character limit""" -# Moved to orm.exc; compatability definition installed by orm import until 0.6 +# Moved to orm.exc; compatibility definition installed by orm import until 0.6 ConcurrentModificationError = None class DisconnectionError(SQLAlchemyError): @@ -51,7 +51,7 @@ """ -# Moved to orm.exc; compatability definition installed by orm import until 0.6 +# Moved to orm.exc; compatibility definition installed by orm import until 0.6 FlushError = None class TimeoutError(SQLAlchemyError): diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/ext/declarative.py --- a/lib/sqlalchemy/ext/declarative.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/ext/declarative.py Mon Mar 14 15:25:07 2011 -0400 @@ -980,9 +980,10 @@ # make sure that column copies are used rather # than the original columns from any mixins - for k, v in mapper_args.iteritems(): - mapper_args[k] = column_copies.get(v,v) - + for k in ('version_id_col', 'polymorphic_on',): + if k in mapper_args: + v = mapper_args[k] + mapper_args[k] = column_copies.get(v,v) if classname in cls._decl_class_registry: util.warn("The classname %r is already in the registry of this" @@ -1160,6 +1161,7 @@ # change this ordering when we do [ticket:1892] our_stuff[k] = p.columns + [col] + cls.__mapper__ = mapper_cls(cls, table, properties=our_stuff, diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/attributes.py --- a/lib/sqlalchemy/orm/attributes.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/attributes.py Mon Mar 14 15:25:07 2011 -0400 @@ -1300,7 +1300,7 @@ class History(tuple): """A 3-tuple of added, unchanged and deleted values, - representing the changes which have occured on an instrumented + representing the changes which have occurred on an instrumented attribute. Each tuple member is an iterable sequence. diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/dependency.py --- a/lib/sqlalchemy/orm/dependency.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/dependency.py Mon Mar 14 15:25:07 2011 -0400 @@ -53,7 +53,7 @@ """establish actions and dependencies related to a flush. These actions will operate on all relevant states in - the aggreagte. + the aggregate. """ uow.register_preprocessor(self, True) diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/interfaces.py --- a/lib/sqlalchemy/orm/interfaces.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/interfaces.py Mon Mar 14 15:25:07 2011 -0400 @@ -953,7 +953,7 @@ This is used to allow more open ended selection of loader strategies, i.e. Mapper -> prop1 -> Subclass -> prop2, where Subclass is a sub-mapper - of the mapper referened by Mapper.prop1. + of the mapper referenced by Mapper.prop1. """ return tuple([i % 2 != 0 and diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/properties.py --- a/lib/sqlalchemy/orm/properties.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/properties.py Mon Mar 14 15:25:07 2011 -0400 @@ -966,7 +966,7 @@ if inheriting is not self.parent \ and inheriting.has_property(self.key): util.warn("Warning: relationship '%s' on mapper " - "'%s' supercedes the same relationship " + "'%s' supersedes the same relationship " "on inherited mapper '%s'; this can " "cause dependency issues during flush" % (self.key, self.parent, inheriting)) @@ -1038,7 +1038,7 @@ def _sync_pairs_from_join(self, join_condition, primary): """Given a join condition, figure out what columns are foreign - and are part of a binary "equated" condition to their referecned + and are part of a binary "equated" condition to their referenced columns, and convert into a list of tuples of (primary col->foreign col). Make several attempts to determine if cols are compared using @@ -1433,7 +1433,7 @@ # adjust the join condition for single table inheritance, # in the case that the join is to a subclass - # this is analgous to the "_adjust_for_single_table_inheritance()" + # this is analogous to the "_adjust_for_single_table_inheritance()" # method in Query. dest_mapper = of_type or self.mapper diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/query.py --- a/lib/sqlalchemy/orm/query.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/query.py Mon Mar 14 15:25:07 2011 -0400 @@ -276,7 +276,7 @@ @property def _mapper_entities(self): - # TODO: this is wrong, its hardcoded to "priamry entity" when + # TODO: this is wrong, its hardcoded to "primary entity" when # for the case of __all_equivs() it should not be # the name of this accessor is wrong too for ent in self._entities: @@ -448,7 +448,7 @@ """Return the full SELECT statement represented by this :class:`.Query`, converted to a scalar subquery with a label of the given name. - Analagous to :meth:`sqlalchemy.sql._SelectBaseMixin.label`. + Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.label`. New in 0.6.5. @@ -461,7 +461,7 @@ """Return the full SELECT statement represented by this :class:`.Query`, converted to a scalar subquery. - Analagous to :meth:`sqlalchemy.sql._SelectBaseMixin.as_scalar`. + Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.as_scalar`. New in 0.6.5. @@ -835,12 +835,12 @@ self._setup_aliasizers(self._entities[l:]) @util.pending_deprecation("0.7", - ":meth:`.add_column` is superceded by :meth:`.add_columns`", + ":meth:`.add_column` is superseded by :meth:`.add_columns`", False) def add_column(self, column): """Add a column expression to the list of result columns to be returned. - Pending deprecation: :meth:`.add_column` will be superceded by + Pending deprecation: :meth:`.add_column` will be superseded by :meth:`.add_columns`. """ @@ -1201,7 +1201,7 @@ @util.accepts_a_list_as_starargs(list_deprecation='deprecated') def outerjoin(self, *props, **kwargs): """Create a left outer join against this ``Query`` object's criterion - and apply generatively, retunring the newly resulting ``Query``. + and apply generatively, returning the newly resulting ``Query``. Usage is the same as the ``join()`` method. @@ -2733,7 +2733,7 @@ # look for ORM entities represented within the # given expression. Try to count only entities - # for columns whos FROM object is in the actual list + # for columns whose FROM object is in the actual list # of FROMs for the overall expression - this helps # subqueries which were built from ORM constructs from # leaking out their entities into the main select construct diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/session.py --- a/lib/sqlalchemy/orm/session.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/session.py Mon Mar 14 15:25:07 2011 -0400 @@ -915,7 +915,7 @@ def expire_all(self): """Expires all persistent instances within this Session. - When any attributes on a persitent instance is next accessed, + When any attributes on a persistent instance is next accessed, a query will be issued using the :class:`.Session` object's current transactional context in order to load all expired attributes for the given instance. Note that @@ -1046,7 +1046,7 @@ not mapper.allow_partial_pks or \ _none_set.issuperset(instance_key[1]): raise exc.FlushError('Instance %s has a NULL identity ' - 'key. Check if this flush is occuring at an ' + 'key. Check if this flush is occurring at an ' 'inappropriate time, such as during a load ' 'operation.' % mapperutil.state_str(state)) diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/orm/sync.py --- a/lib/sqlalchemy/orm/sync.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/orm/sync.py Mon Mar 14 15:25:07 2011 -0400 @@ -23,7 +23,7 @@ except exc.UnmappedColumnError: _raise_col_to_prop(True, source_mapper, l, dest_mapper, r) - # techically the "r.primary_key" check isn't + # technically the "r.primary_key" check isn't # needed here, but we check for this condition to limit # how often this logic is invoked for memory/performance # reasons, since we only need this info for a primary key diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/sql/expression.py --- a/lib/sqlalchemy/sql/expression.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/sql/expression.py Mon Mar 14 15:25:07 2011 -0400 @@ -2216,7 +2216,7 @@ return fromclause in self._cloned_set def replace_selectable(self, old, alias): - """replace all occurences of FromClause 'old' with the given Alias + """replace all occurrences of FromClause 'old' with the given Alias object, returning a copy of this :class:`FromClause`. """ diff -r 3861c784aa8a -r fadc6d665b5e lib/sqlalchemy/sql/util.py --- a/lib/sqlalchemy/sql/util.py Sat Mar 05 12:19:40 2011 -0500 +++ b/lib/sqlalchemy/sql/util.py Mon Mar 14 15:25:07 2011 -0400 @@ -334,7 +334,7 @@ # detect immutable, don't change anything return self else: - # update the clone with any changes that have occured + # update the clone with any changes that have occurred # to this object's __dict__. clone.__dict__.update(self.__dict__) return Annotated(clone, self._annotations) diff -r 3861c784aa8a -r fadc6d665b5e test/dialect/test_mysql.py --- a/test/dialect/test_mysql.py Sat Mar 05 12:19:40 2011 -0500 +++ b/test/dialect/test_mysql.py Mon Mar 14 15:25:07 2011 -0400 @@ -384,7 +384,7 @@ meta.drop_all() def test_boolean(self): - """Test BOOL/TINYINT(1) compatability and reflection.""" + """Test BOOL/TINYINT(1) compatibility and reflection.""" meta = MetaData(testing.db) bool_table = Table( diff -r 3861c784aa8a -r fadc6d665b5e test/engine/test_transaction.py --- a/test/engine/test_transaction.py Sat Mar 05 12:19:40 2011 -0500 +++ b/test/engine/test_transaction.py Mon Mar 14 15:25:07 2011 -0400 @@ -444,7 +444,7 @@ eq_(conn2.execute(select([foo.c.data])).fetchall(), [('data1', )]) - # connection supercedes statement + # connection supersedes statement conn1.execution_options(autocommit=False).\ execute(select([func.insert_foo('data2' diff -r 3861c784aa8a -r fadc6d665b5e test/ext/test_declarative.py --- a/test/ext/test_declarative.py Sat Mar 05 12:19:40 2011 -0500 +++ b/test/ext/test_declarative.py Mon Mar 14 15:25:07 2011 -0400 @@ -1169,7 +1169,28 @@ assert 'inherits' not in Person.__mapper_args__ assert class_mapper(Engineer).polymorphic_identity is None assert class_mapper(Engineer).polymorphic_on is Person.__table__.c.type - + + def test_we_must_only_copy_column_mapper_args(self): + + class Person(Base): + + __tablename__ = 'people' + id = Column(Integer, primary_key=True) + a=Column(Integer) + b=Column(Integer) + c=Column(Integer) |