]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- pending deprecation in 0.7 for the execute/scalar on clauseelement
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Sep 2010 15:57:19 +0000 (11:57 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Sep 2010 15:57:19 +0000 (11:57 -0400)
CHANGES
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/test/testing.py
test/sql/test_query.py

diff --git a/CHANGES b/CHANGES
index 5a65d046a4a7e2b1838c181066596a0319b4101b..777f4c6a0a26e8d535e457d1c7d3a5c06cb8c2ac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -175,6 +175,20 @@ CHANGES
     NULL.
     
 - sql
+  - Calling execute() on an alias() construct is pending
+    deprecation for 0.7, as it is not itself an
+    "executable" construct. It currently "proxies" its
+    inner element and is conditionally "executable" but
+    this is not the kind of ambiguity we like these days.
+    
+  - The execute() and scalar() methods of ClauseElement
+    are now moved appropriately to the Executable
+    subclass. ClauseElement.execute()/ scalar() are still
+    present and are pending deprecation in 0.7, but note
+    these would always raise an error anyway if you were
+    not an Executable (unless you were an alias(), see
+    previous note).
+    
   - Added basic math expression coercion for 
     Numeric->Integer,
     so that resulting type is Numeric regardless
index 76f3617a2af1a169780e6edee19b80b2f1d7fbfe..b87bdc890af3a0d5782136c118c9ff6c4a0d8ad6 100644 (file)
@@ -932,7 +932,7 @@ class Mapper(object):
                 else:
                     return None
     
-    @util.deprecated('0.7',
+    @util.deprecated('0.6.4',
                      'Call to deprecated function mapper._get_col_to_pr'
                      'op(). Use mapper.get_property_by_column()')
     def _get_col_to_prop(self, col):
index 5235a696bb6763af8730cd3964a91e4c891cf9e1..1b1cfee8a79d1ac3aed72b49a52abb7b15e57303 100644 (file)
@@ -1270,8 +1270,10 @@ class ClauseElement(Visitable):
         else:
             return None
     
-    @util.deprecated("0.7", "Only SQL expressions which subclass :class:`.Executable` "
-                        "may provide the :func:`.execute` method.")
+    @util.pending_deprecation('0.7',
+                              'Only SQL expressions which subclass '
+                              ':class:`.Executable` may provide the '
+                              ':func:`.execute` method.')
     def execute(self, *multiparams, **params):
         """Compile and execute this :class:`ClauseElement`.
         
@@ -1287,11 +1289,13 @@ class ClauseElement(Visitable):
             raise exc.UnboundExecutionError(msg)
         return e._execute_clauseelement(self, multiparams, params)
 
-    @util.deprecated("0.7", "Only SQL expressions which subclass :class:`.Executable` "
-                        "may provide the :func:`.scalar` method.")
+    @util.pending_deprecation('0.7',
+                              'Only SQL expressions which subclass '
+                              ':class:`.Executable` may provide the '
+                              ':func:`.scalar` method.')
     def scalar(self, *multiparams, **params):
-        """Compile and execute this :class:`ClauseElement`, returning the
-        result's scalar representation.
+        """Compile and execute this :class:`ClauseElement`, returning
+        the result's scalar representation.
         
         """
         return self.execute(*multiparams, **params).scalar()
index d09621dc8b5108c661ad23145acf1803d0e1d713..41ba3038f2e45dc42e55c02ec65153daba4deca3 100644 (file)
@@ -436,8 +436,6 @@ def resetwarnings():
 
 #    warnings.simplefilter('error')
 
-    if sys.version_info < (2, 4):
-        warnings.filterwarnings('ignore', category=FutureWarning)
 
 def global_cleanup_assertions():
     """Check things that have to be finalized at the end of a test suite.
index d78ddbb5722605e001cd6456b226c6b482655ee4..2093e1f69c814cc78ecc7a1407c8bd67a2e27306 100644 (file)
@@ -216,7 +216,7 @@ class QueryTest(TestBase):
                 {'user_name':'jack'},
             )
             assert r.closed
-        
+    
     def test_row_iteration(self):
         users.insert().execute(
             {'user_id':7, 'user_name':'jack'},