Commits

jason kirtland committed 2f72451

- Tightened up **kw on ColumnProperty and its front-end functions.

Comments (0)

Files changed (2)

       operation, greatly simplifying typical usage patterns
       within declarative. [ticket:1269]
 
+    - ColumnProperty (and front-end helpers such as ``deferred``) no
+      longer ignores unknown **keyword arguments.
+
 - schema
     - Index now accepts column-oriented InstrumentedAttributes
       (i.e. column-based mapped class attributes) as column

lib/sqlalchemy/orm/properties.py

     """Describes an object attribute that corresponds to a table column."""
 
     def __init__(self, *columns, **kwargs):
-        """The list of `columns` describes a single object
-        property. If there are multiple tables joined together for the
-        mapper, this list represents the equivalent column as it
-        appears across each table.
+        """Construct a ColumnProperty.
+
+        :param \*columns: The list of `columns` describes a single
+          object property. If there are multiple tables joined
+          together for the mapper, this list represents the equivalent
+          column as it appears across each table.
+
+        :param group:
+
+        :param deferred:
+
+        :param comparator_factory:
+
+        :param descriptor:
+
+        :param extension:
+
         """
-
         self.columns = [expression._labeled(c) for c in columns]
         self.group = kwargs.pop('group', None)
         self.deferred = kwargs.pop('deferred', False)
         self.comparator_factory = kwargs.pop('comparator_factory', self.__class__.Comparator)
         self.descriptor = kwargs.pop('descriptor', None)
         self.extension = kwargs.pop('extension', None)
+        if kwargs:
+            raise TypeError(
+                "%s received unexpected keyword argument(s): %s" % (
+                    self.__class__.__name__, ', '.join(sorted(kwargs.keys()))))
+
         util.set_creation_order(self)
         if self.no_instrument:
             self.strategy_class = strategies.UninstrumentedColumnLoader
 mapper.SynonymProperty = SynonymProperty
 mapper.ComparableProperty = ComparableProperty
 mapper.RelationProperty = RelationProperty
-mapper.ConcreteInheritedProperty = ConcreteInheritedProperty
+mapper.ConcreteInheritedProperty = ConcreteInheritedProperty