]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
removed deprecated codes before sqa 1.1 from sql.schema 4893/head
authorAsif Saif Uddin (Auvi) <auvipy@gmail.com>
Sun, 6 Oct 2019 04:32:55 +0000 (10:32 +0600)
committerAsif Saif Uddin (Auvi) <auvipy@gmail.com>
Sun, 6 Oct 2019 04:32:55 +0000 (10:32 +0600)
lib/sqlalchemy/sql/schema.py

index d5ee1057b86c00262baaed8fe9301da4c78aa7f6..af538af0e71c55264aaf7702657bbd018fea121a 100644 (file)
@@ -123,23 +123,6 @@ class SchemaItem(SchemaEventTarget, visitors.Visitable):
     def __repr__(self):
         return util.generic_repr(self, omit_kwarg=["info"])
 
-    @property
-    @util.deprecated(
-        "0.9",
-        "The :attr:`.SchemaItem.quote` attribute is deprecated and will be "
-        "removed in a future release.  Use the :attr:`.quoted_name.quote` "
-        "attribute on the ``name`` field of the target schema item to retrieve"
-        "quoted status.",
-    )
-    def quote(self):
-        """Return the value of the ``quote`` flag passed
-        to this schema object, for those schema items which
-        have a ``name`` field.
-
-        """
-
-        return self.name.quote
-
     @util.memoized_property
     def info(self):
         """Info dictionary associated with the object, allowing user-defined
@@ -442,14 +425,6 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
 
     __visit_name__ = "table"
 
-    @util.deprecated_params(
-        useexisting=(
-            "0.7",
-            "The :paramref:`.Table.useexisting` parameter is deprecated and "
-            "will be removed in a future release.  Please use "
-            ":paramref:`.Table.extend_existing`.",
-        )
-    )
     def __new__(cls, *args, **kw):
         if not args:
             # python3k pickle seems to call this
@@ -467,11 +442,6 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
             schema = None
         keep_existing = kw.pop("keep_existing", False)
         extend_existing = kw.pop("extend_existing", False)
-        if "useexisting" in kw:
-            if extend_existing:
-                msg = "useexisting is synonymous with extend_existing."
-                raise exc.ArgumentError(msg)
-            extend_existing = kw.pop("useexisting", False)
 
         if keep_existing and extend_existing:
             msg = "keep_existing and extend_existing are mutually exclusive."
@@ -506,21 +476,6 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
                 with util.safe_reraise():
                     metadata._remove_table(name, schema)
 
-    @property
-    @util.deprecated(
-        "0.9",
-        "The :meth:`.SchemaItem.quote` method is deprecated and will be "
-        "removed in a future release.  Use the :attr:`.quoted_name.quote` "
-        "attribute on the ``schema`` field of the target schema item to "
-        "retrieve quoted status.",
-    )
-    def quote_schema(self):
-        """Return the value of the ``quote_schema`` flag passed
-        to this :class:`.Table`.
-        """
-
-        return self.schema.quote
-
     def __init__(self, *args, **kw):
         """Constructor for :class:`~.schema.Table`.
 
@@ -801,22 +756,6 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
 
         constraint._set_parent_with_dispatch(self)
 
-    @util.deprecated(
-        "0.7",
-        "the :meth:`.Table.append_ddl_listener` method is deprecated and "
-        "will be removed in a future release.  Please refer to "
-        ":class:`.DDLEvents`.",
-    )
-    def append_ddl_listener(self, event_name, listener):
-        """Append a DDL event listener to this ``Table``.
-
-        """
-
-        def adapt_listener(target, connection, **kw):
-            listener(event_name, target, connection)
-
-        event.listen(self, "" + event_name.replace("-", "_"), adapt_listener)
-
     def _set_parent(self, metadata):
         metadata._add_table(self.name, self.schema, self)
         self.metadata = metadata
@@ -2634,19 +2573,6 @@ class DefaultClause(FetchedValue):
         return "DefaultClause(%r, for_update=%r)" % (self.arg, self.for_update)
 
 
-@util.deprecated_cls(
-    "0.6",
-    ":class:`.PassiveDefault` is deprecated and will be removed in a "
-    "future release.  Please refer to :class:`.DefaultClause`.",
-)
-class PassiveDefault(DefaultClause):
-    """A DDL-specified DEFAULT column value.
-    """
-
-    def __init__(self, *arg, **kw):
-        DefaultClause.__init__(self, *arg, **kw)
-
-
 class Constraint(DialectKWArgs, SchemaItem):
     """A table-level SQL constraint."""
 
@@ -3747,18 +3673,9 @@ class MetaData(SchemaItem):
 
     __visit_name__ = "metadata"
 
-    @util.deprecated_params(
-        reflect=(
-            "0.8",
-            "The :paramref:`.MetaData.reflect` flag is deprecated and will "
-            "be removed in a future release.   Please use the "
-            ":meth:`.MetaData.reflect` method.",
-        )
-    )
     def __init__(
         self,
         bind=None,
-        reflect=False,
         schema=None,
         quote_schema=None,
         naming_convention=None,
@@ -3927,13 +3844,6 @@ class MetaData(SchemaItem):
         self._fk_memos = collections.defaultdict(list)
 
         self.bind = bind
-        if reflect:
-            if not bind:
-                raise exc.ArgumentError(
-                    "A bind must be supplied in conjunction "
-                    "with reflect=True"
-                )
-            self.reflect()
 
     tables = None
     """A dictionary of :class:`.Table` objects keyed to their name or "table key".
@@ -4238,24 +4148,6 @@ class MetaData(SchemaItem):
                 except exc.UnreflectableTableError as uerr:
                     util.warn("Skipping table %s: %s" % (name, uerr))
 
-    @util.deprecated(
-        "0.7",
-        "the :meth:`.MetaData.append_ddl_listener` method is deprecated and "
-        "will be removed in a future release.  Please refer to "
-        ":class:`.DDLEvents`.",
-    )
-    def append_ddl_listener(self, event_name, listener):
-        """Append a DDL event listener to this ``MetaData``.
-
-
-        """
-
-        def adapt_listener(target, connection, **kw):
-            tables = kw["tables"]
-            listener(event, target, connection, tables=tables)
-
-        event.listen(self, "" + event_name.replace("-", "_"), adapt_listener)
-
     def create_all(self, bind=None, tables=None, checkfirst=True):
         """Create all tables stored in this metadata.