From fa6dd376bb24845724287d980a98ea50eb1cfab1 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 11 Jan 2017 10:12:12 -0500 Subject: Support python3.6 Corrects some warnings and adds tox config. Adds DeprecationWarning to the error category. Large sweep for string literals w/ backslashes as this is common in docstrings Co-authored-by: Andrii Soldatenko Fixes: #3886 Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337 --- lib/sqlalchemy/engine/base.py | 16 ++++++++-------- lib/sqlalchemy/engine/interfaces.py | 4 ++-- lib/sqlalchemy/engine/url.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/sqlalchemy/engine') diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 0c75eef5e..0334d2d7a 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -165,7 +165,7 @@ class Connection(Connectable): self.close() def execution_options(self, **opt): - """ Set non-SQL options for the connection which take effect + r""" Set non-SQL options for the connection which take effect during execution. The method returns a copy of this :class:`.Connection` which references @@ -175,7 +175,7 @@ class Connection(Connectable): underlying resource, it's usually a good idea to ensure that the copies will be discarded immediately, which is implicit if used as in:: - result = connection.execution_options(stream_results=True).\\ + result = connection.execution_options(stream_results=True).\ execute(stmt) Note that any key/value can be passed to @@ -877,7 +877,7 @@ class Connection(Connectable): return self.execute(object, *multiparams, **params).scalar() def execute(self, object, *multiparams, **params): - """Executes a SQL statement construct and returns a + r"""Executes a SQL statement construct and returns a :class:`.ResultProxy`. :param object: The statement to be executed. May be @@ -1459,7 +1459,7 @@ class Connection(Connectable): util.reraise(*exc_info) def transaction(self, callable_, *args, **kwargs): - """Execute the given function within a transaction boundary. + r"""Execute the given function within a transaction boundary. The function is passed this :class:`.Connection` as the first argument, followed by the given \*args and \**kwargs, @@ -1510,7 +1510,7 @@ class Connection(Connectable): trans.rollback() def run_callable(self, callable_, *args, **kwargs): - """Given a callable object or function, execute it, passing + r"""Given a callable object or function, execute it, passing a :class:`.Connection` as the first argument. The given \*args and \**kwargs are passed subsequent @@ -1769,7 +1769,7 @@ class Engine(Connectable, log.Identified): self.update_execution_options(**execution_options) def update_execution_options(self, **opt): - """Update the default execution_options dictionary + r"""Update the default execution_options dictionary of this :class:`.Engine`. The given keys/values in \**opt are added to the @@ -1978,7 +1978,7 @@ class Engine(Connectable, log.Identified): return Engine._trans_ctx(conn, trans, close_with_result) def transaction(self, callable_, *args, **kwargs): - """Execute the given function within a transaction boundary. + r"""Execute the given function within a transaction boundary. The function is passed a :class:`.Connection` newly procured from :meth:`.Engine.contextual_connect` as the first argument, @@ -2020,7 +2020,7 @@ class Engine(Connectable, log.Identified): return conn.transaction(callable_, *args, **kwargs) def run_callable(self, callable_, *args, **kwargs): - """Given a callable object or function, execute it, passing + r"""Given a callable object or function, execute it, passing a :class:`.Connection` as the first argument. The given \*args and \**kwargs are passed subsequent diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 38b5442d8..d0eff1cb1 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -378,7 +378,7 @@ class Dialect(object): def get_unique_constraints( self, connection, table_name, schema=None, **kw): - """Return information about unique constraints in `table_name`. + r"""Return information about unique constraints in `table_name`. Given a string `table_name` and an optional string `schema`, return unique constraint information as a list of dicts with these keys: @@ -401,7 +401,7 @@ class Dialect(object): def get_check_constraints( self, connection, table_name, schema=None, **kw): - """Return information about check constraints in `table_name`. + r"""Return information about check constraints in `table_name`. Given a string `table_name` and an optional string `schema`, return check constraint information as a list of dicts with these keys: diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 9d5b784eb..1c16584f1 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -156,7 +156,7 @@ class URL(object): return dialect_cls def translate_connect_args(self, names=[], **kw): - """Translate url attributes into a dictionary of connection arguments. + r"""Translate url attributes into a dictionary of connection arguments. Returns attributes of this url (`host`, `database`, `username`, `password`, `port`) as a plain dictionary. The attribute names are -- cgit v1.2.1