diff options
author | Asif Saif Uddin (Auvi) <auvipy@gmail.com> | 2019-10-06 12:32:10 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-10-11 13:29:38 -0400 |
commit | d9d576f1fda3687c3475511805895925ceba53b0 (patch) | |
tree | 75824f3984f6c8e50038c6a0fa38662200361dfe /lib/sqlalchemy/sql/schema.py | |
parent | 476df84ec995324cf2162b9b28ad8a58b90cfadf (diff) | |
download | sqlalchemy-d9d576f1fda3687c3475511805895925ceba53b0.tar.gz |
Remove deprecated elements
Includes:
PassiveDefault
SchemaItem.quote
Table.useexisting
Table.quote_schema
Table.append_ddl_listener
MetaData.append_ddl_listener
Metadata.reflect kw parameter (use reflect() method)
DDL.execute_at
DDL.on
Partially-fixes: #4643
Closes: #4893
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4893
Pull-request-sha: 860eb6a253fe4a95685b4f5f3349b19823a304f3
Change-Id: I0f5b8a873e7581365ff8dba48eab358d9e8e7b13
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index d5ee1057b..af538af0e 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -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. |