diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-28 14:08:59 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-28 15:17:26 -0400 |
| commit | c3f102c9fe9811fd5286628cc6aafa5fbc324621 (patch) | |
| tree | 4a78723089ded623701667de1eee21d22edbe6c1 /lib/sqlalchemy/dialects/postgresql | |
| parent | 75ac0abc7d5653d10006769a881374a46b706db5 (diff) | |
| download | sqlalchemy-c3f102c9fe9811fd5286628cc6aafa5fbc324621.tar.gz | |
upgrade to black 20.8b1
It's better, the majority of these changes look more readable to me.
also found some docstrings that had formatting / quoting issues.
Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/asyncpg.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 14 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/hstore.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/json.py | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/ranges.py | 24 |
5 files changed, 23 insertions, 35 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index 1f988153c..8b20de2b6 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -576,11 +576,13 @@ class AsyncAdapt_asyncpg_dbapi: if async_fallback: return AsyncAdaptFallback_asyncpg_connection( - self, await_fallback(self.asyncpg.connect(*arg, **kw)), + self, + await_fallback(self.asyncpg.connect(*arg, **kw)), ) else: return AsyncAdapt_asyncpg_connection( - self, await_only(self.asyncpg.connect(*arg, **kw)), + self, + await_only(self.asyncpg.connect(*arg, **kw)), ) class Error(Exception): diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 878693866..5ed56db56 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1338,9 +1338,7 @@ class TIME(sqltypes.TIME): class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): - """PostgreSQL INTERVAL type. - - """ + """PostgreSQL INTERVAL type.""" __visit_name__ = "INTERVAL" native = True @@ -1414,7 +1412,7 @@ class UUID(sqltypes.TypeEngine): as Python uuid objects, converting to/from string via the DBAPI. - """ + """ self.as_uuid = as_uuid def coerce_compared_value(self, op, value): @@ -3026,7 +3024,9 @@ class PGDialect(default.DefaultDialect): type_=sqltypes.Unicode, ), sql.bindparam( - "schema", util.text_type(schema), type_=sqltypes.Unicode, + "schema", + util.text_type(schema), + type_=sqltypes.Unicode, ), ) ) @@ -3200,7 +3200,9 @@ class PGDialect(default.DefaultDialect): "n.nspname=:schema" ).bindparams( sql.bindparam( - "schema", util.text_type(schema), type_=sqltypes.Unicode, + "schema", + util.text_type(schema), + type_=sqltypes.Unicode, ), ) ) diff --git a/lib/sqlalchemy/dialects/postgresql/hstore.py b/lib/sqlalchemy/dialects/postgresql/hstore.py index cb89f7c5f..15ec2a585 100644 --- a/lib/sqlalchemy/dialects/postgresql/hstore.py +++ b/lib/sqlalchemy/dialects/postgresql/hstore.py @@ -160,13 +160,11 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): return self.operate(HAS_KEY, other, result_type=sqltypes.Boolean) def has_all(self, other): - """Boolean expression. Test for presence of all keys in jsonb - """ + """Boolean expression. Test for presence of all keys in jsonb""" return self.operate(HAS_ALL, other, result_type=sqltypes.Boolean) def has_any(self, other): - """Boolean expression. Test for presence of any key in jsonb - """ + """Boolean expression. Test for presence of any key in jsonb""" return self.operate(HAS_ANY, other, result_type=sqltypes.Boolean) def contains(self, other, **kwargs): diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py index 9ffe9cfe8..63e1656e0 100644 --- a/lib/sqlalchemy/dialects/postgresql/json.py +++ b/lib/sqlalchemy/dialects/postgresql/json.py @@ -204,7 +204,7 @@ class JSON(sqltypes.JSON): .. versionadded:: 1.1 - """ + """ super(JSON, self).__init__(none_as_null=none_as_null) if astext_type is not None: self.astext_type = astext_type @@ -300,13 +300,11 @@ class JSONB(JSON): return self.operate(HAS_KEY, other, result_type=sqltypes.Boolean) def has_all(self, other): - """Boolean expression. Test for presence of all keys in jsonb - """ + """Boolean expression. Test for presence of all keys in jsonb""" return self.operate(HAS_ALL, other, result_type=sqltypes.Boolean) def has_any(self, other): - """Boolean expression. Test for presence of any key in jsonb - """ + """Boolean expression. Test for presence of any key in jsonb""" return self.operate(HAS_ANY, other, result_type=sqltypes.Boolean) def contains(self, other, **kwargs): diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py index a31d958ed..ddc12c096 100644 --- a/lib/sqlalchemy/dialects/postgresql/ranges.py +++ b/lib/sqlalchemy/dialects/postgresql/ranges.py @@ -100,48 +100,36 @@ class RangeOperators(object): class INT4RANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL INT4RANGE type. - - """ + """Represent the PostgreSQL INT4RANGE type.""" __visit_name__ = "INT4RANGE" class INT8RANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL INT8RANGE type. - - """ + """Represent the PostgreSQL INT8RANGE type.""" __visit_name__ = "INT8RANGE" class NUMRANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL NUMRANGE type. - - """ + """Represent the PostgreSQL NUMRANGE type.""" __visit_name__ = "NUMRANGE" class DATERANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL DATERANGE type. - - """ + """Represent the PostgreSQL DATERANGE type.""" __visit_name__ = "DATERANGE" class TSRANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL TSRANGE type. - - """ + """Represent the PostgreSQL TSRANGE type.""" __visit_name__ = "TSRANGE" class TSTZRANGE(RangeOperators, sqltypes.TypeEngine): - """Represent the PostgreSQL TSTZRANGE type. - - """ + """Represent the PostgreSQL TSTZRANGE type.""" __visit_name__ = "TSTZRANGE" |
