diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2022-01-05 12:41:32 -0500 |
---|---|---|
committer | sqla-tester <sqla-tester@sqlalchemy.org> | 2022-01-05 12:41:32 -0500 |
commit | 146a349d81023805264f81643db50a5281da90da (patch) | |
tree | 8c0b6e56e3f29b8187de1b8a9af21af4cebbd6a2 /lib/sqlalchemy/sql | |
parent | 028f9b5cacc1b70aa0f4f53799f6e7c14a182776 (diff) | |
download | sqlalchemy-146a349d81023805264f81643db50a5281da90da.tar.gz |
Update Black's target-version to py37
<!-- Provide a general summary of your proposed changes in the Title field above -->
### Description
<!-- Describe your changes in detail -->
Black's `target-version` was still set to `['py27', 'py36']`. Set it to `[py37]` instead.
Also update Black and other pre-commit hooks and re-format with Black.
### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)
-->
This pull request is:
- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests. one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.
**Have a nice day!**
Closes: #7536
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7536
Pull-request-sha: b3aedf5570d7e0ba6c354e5989835260d0591b08
Change-Id: I8be85636fd2c9449b07a8626050c8bd35bd119d5
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/coercions.py | 10 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 46 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/crud.py | 8 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/default_comparator.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/dml.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 12 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/functions.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/lambdas.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 34 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 2 |
11 files changed, 68 insertions, 68 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py index 1a0336c67..d11ab6712 100644 --- a/lib/sqlalchemy/sql/coercions.py +++ b/lib/sqlalchemy/sql/coercions.py @@ -115,7 +115,7 @@ def expect( apply_propagate_attrs=None, argname=None, post_inspect=False, - **kw + **kw, ): if ( role.allows_lambda @@ -205,7 +205,7 @@ def expect( resolved, argname=argname, original_element=original_element, - **kw + **kw, ) return resolved else: @@ -441,7 +441,7 @@ class _SelectIsNotFrom: resolved=resolved, advice=advice, code=code, - **kw + **kw, ) @@ -956,7 +956,7 @@ class FromClauseImpl(_SelectIsNotFrom, _NoTextCoercion, RoleImpl): argname=None, explicit_subquery=False, allow_select=True, - **kw + **kw, ): if resolved._is_select_statement: if explicit_subquery: @@ -991,7 +991,7 @@ class StrictFromClauseImpl(FromClauseImpl): resolved, argname=None, allow_select=False, - **kw + **kw, ): if resolved._is_select_statement and allow_select: util.warn_deprecated( diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 90f32a4f7..cea6d97b8 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -694,7 +694,7 @@ class SQLCompiler(Compiled): column_keys=None, for_executemany=False, linting=NO_LINTING, - **kwargs + **kwargs, ): """Construct a new :class:`.SQLCompiler` object. @@ -1369,7 +1369,7 @@ class SQLCompiler(Compiled): return self.process( element.element, within_columns_clause=within_columns_clause, - **kwargs + **kwargs, ) def visit_textual_label_reference( @@ -1410,7 +1410,7 @@ class SQLCompiler(Compiled): within_columns_clause=False, render_label_as_label=None, result_map_targets=(), - **kw + **kw, ): # only render labels within the columns clause # or ORDER BY clause of a select. dialect-specific compilers @@ -1439,7 +1439,7 @@ class SQLCompiler(Compiled): self, within_columns_clause=True, within_label_clause=True, - **kw + **kw, ) + OPERATORS[operators.as_] + self.preparer.format_label(label, labelname) @@ -1466,7 +1466,7 @@ class SQLCompiler(Compiled): add_to_result_map=None, include_table=True, result_map_targets=(), - **kwargs + **kwargs, ): name = orig_name = column.name if name is None: @@ -2135,7 +2135,7 @@ class SQLCompiler(Compiled): eager_grouping=False, from_linter=None, lateral_from_linter=None, - **kw + **kw, ): if from_linter and operators.is_comparison(binary.operator): if lateral_from_linter is not None: @@ -2176,7 +2176,7 @@ class SQLCompiler(Compiled): opstring, from_linter=from_linter, lateral_from_linter=lateral_from_linter, - **kw + **kw, ) def visit_function_as_comparison_op_binary(self, element, operator, **kw): @@ -2201,7 +2201,7 @@ class SQLCompiler(Compiled): return self._generate_generic_binary( element, " " + self.escape_literal_column(operator.opstring) + " ", - **kw + **kw, ) def visit_custom_op_unary_operator(self, element, operator, **kw): @@ -2339,7 +2339,7 @@ class SQLCompiler(Compiled): return self._generate_generic_binary( binary, " NOT BETWEEN SYMMETRIC " if symmetric else " NOT BETWEEN ", - **kw + **kw, ) def visit_regexp_match_op_binary(self, binary, operator, **kw): @@ -2368,7 +2368,7 @@ class SQLCompiler(Compiled): skip_bind_expression=False, literal_execute=False, render_postcompile=False, - **kwargs + **kwargs, ): if not skip_bind_expression: impl = bindparam.type.dialect_impl(self.dialect) @@ -2381,7 +2381,7 @@ class SQLCompiler(Compiled): literal_binds=literal_binds, literal_execute=literal_execute, render_postcompile=render_postcompile, - **kwargs + **kwargs, ) if bindparam.expanding: # for postcompile w/ expanding, move the "wrapped" part @@ -2478,7 +2478,7 @@ class SQLCompiler(Compiled): post_compile=post_compile, expanding=bindparam.expanding, bindparam_type=bindparam.type, - **kwargs + **kwargs, ) if bindparam.expanding: @@ -2576,7 +2576,7 @@ class SQLCompiler(Compiled): expanding=False, escaped_from=None, bindparam_type=None, - **kw + **kw, ): if self.positional: @@ -2624,7 +2624,7 @@ class SQLCompiler(Compiled): fromhints=None, visiting_cte=None, from_linter=None, - **kwargs + **kwargs, ): self._init_cte_state() @@ -2813,7 +2813,7 @@ class SQLCompiler(Compiled): lateral=False, enclosing_alias=None, from_linter=None, - **kwargs + **kwargs, ): if lateral: @@ -2842,7 +2842,7 @@ class SQLCompiler(Compiled): fromhints=fromhints, lateral=lateral, enclosing_alias=alias, - **kwargs + **kwargs, ) if subquery and (asfrom or lateral): inner = "(%s)" % (inner,) @@ -2929,7 +2929,7 @@ class SQLCompiler(Compiled): elements.Tuple( types=element._column_types, *elem ).self_group(), - **kw + **kw, ) for chunk in element._data for elem in chunk @@ -3233,7 +3233,7 @@ class SQLCompiler(Compiled): select_wraps_for=None, lateral=False, from_linter=None, - **kwargs + **kwargs, ): assert select_wraps_for is None, ( "SQLAlchemy 1.4 requires use of " @@ -3526,7 +3526,7 @@ class SQLCompiler(Compiled): asfrom=True, fromhints=byfrom, from_linter=from_linter, - **kwargs + **kwargs, ) for f in froms ] @@ -3538,7 +3538,7 @@ class SQLCompiler(Compiled): self, asfrom=True, from_linter=from_linter, - **kwargs + **kwargs, ) for f in froms ] @@ -3732,7 +3732,7 @@ class SQLCompiler(Compiled): fromhints=None, use_schema=True, from_linter=None, - **kwargs + **kwargs, ): if from_linter: from_linter.froms[table] = table.fullname @@ -4054,7 +4054,7 @@ class SQLCompiler(Compiled): update_stmt.table, render_extra_froms, dialect_hints, - **kw + **kw, ) if extra_from_text: text += " " + extra_from_text @@ -4164,7 +4164,7 @@ class SQLCompiler(Compiled): delete_stmt.table, extra_froms, dialect_hints, - **kw + **kw, ) if extra_from_text: text += " " + extra_from_text diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py index a313257ca..27bc08081 100644 --- a/lib/sqlalchemy/sql/crud.py +++ b/lib/sqlalchemy/sql/crud.py @@ -494,7 +494,7 @@ def _append_param_parameter( name=_col_bind_name(c) if not compile_state._has_multi_parameters else "%s_m0" % _col_bind_name(c), - **kw + **kw, ) elif value._is_bind_parameter: value = _handle_values_anonymous_param( @@ -504,7 +504,7 @@ def _append_param_parameter( name=_col_bind_name(c) if not compile_state._has_multi_parameters else "%s_m0" % _col_bind_name(c), - **kw + **kw, ) else: # value is a SQL expression @@ -881,7 +881,7 @@ def _get_update_multitable_params( value, required=value is REQUIRED, name=_col_bind_name(c), - **kw # TODO: no test coverage for literal binds here + **kw, # TODO: no test coverage for literal binds here ) elif value._is_bind_parameter: value = _handle_values_anonymous_param( @@ -949,7 +949,7 @@ def _extend_values_for_multiparams( col, row[key], name="%s_m%d" % (col.key, i + 1), - **kw + **kw, ) else: new_param = compiler.process(row[key].self_group(), **kw) diff --git a/lib/sqlalchemy/sql/default_comparator.py b/lib/sqlalchemy/sql/default_comparator.py index 2bbead673..d849f8aba 100644 --- a/lib/sqlalchemy/sql/default_comparator.py +++ b/lib/sqlalchemy/sql/default_comparator.py @@ -36,7 +36,7 @@ def _boolean_compare( _python_is_types=(util.NoneType, bool), _any_all_expr=False, result_type=None, - **kwargs + **kwargs, ): if result_type is None: @@ -215,7 +215,7 @@ def _match_impl(expr, op, other, **kw): negate=operators.not_match_op if op is operators.match_op else operators.match_op, - **kw + **kw, ) @@ -275,7 +275,7 @@ def _regexp_match_impl(expr, op, pattern, flags, **kw): negate=operators.not_regexp_match_op if op is operators.regexp_match_op else operators.regexp_match_op, - **kw + **kw, ) diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index ab0a05651..feb286d65 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -854,7 +854,7 @@ class Insert(ValuesBase): prefixes=None, returning=None, return_defaults=False, - **dialect_kw + **dialect_kw, ): """Construct an :class:`_expression.Insert` object. @@ -1165,7 +1165,7 @@ class Update(DMLWhereBase, ValuesBase): returning=None, return_defaults=False, preserve_parameter_order=False, - **dialect_kw + **dialect_kw, ): r"""Construct an :class:`_expression.Update` object. @@ -1384,7 +1384,7 @@ class Delete(DMLWhereBase, UpdateBase): whereclause=None, returning=None, prefixes=None, - **dialect_kw + **dialect_kw, ): r"""Construct :class:`_expression.Delete` object. diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index f6606e01d..6e5fbba88 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -516,7 +516,7 @@ class ClauseElement( column_keys=None, for_executemany=False, schema_translate_map=None, - **kw + **kw, ): if compiled_cache is not None and dialect._supports_statement_cache: elem_cache_key = self._generate_cache_key() @@ -542,7 +542,7 @@ class ClauseElement( column_keys=column_keys, for_executemany=for_executemany, schema_translate_map=schema_translate_map, - **kw + **kw, ) compiled_cache[key] = compiled_sql else: @@ -555,7 +555,7 @@ class ClauseElement( column_keys=column_keys, for_executemany=for_executemany, schema_translate_map=schema_translate_map, - **kw + **kw, ) if not dialect._supports_statement_cache: @@ -4134,7 +4134,7 @@ class Over(ColumnElement): if partition_by is not None: self.partition_by = ClauseList( *util.to_list(partition_by), - _literal_as_text_role=roles.ByOfRole + _literal_as_text_role=roles.ByOfRole, ) if range_: @@ -4667,7 +4667,7 @@ class NamedColumn(ColumnElement): name=None, name_is_truncatable=False, disallow_is_literal=False, - **kw + **kw, ): c = ColumnClause( coercions.expect(roles.TruncatedLabelRole, name or self.name) @@ -4965,7 +4965,7 @@ class ColumnClause( name=None, name_is_truncatable=False, disallow_is_literal=False, - **kw + **kw, ): # the "is_literal" flag normally should never be propagated; a proxied # column is always a SQL identifier and never the actual expression diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index fa0b06421..29f2ce868 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -580,7 +580,7 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative): _compared_to_type=self.type, unique=True, type_=type_, - **kw + **kw, ) def self_group(self, against=None): @@ -867,7 +867,7 @@ class Function(FunctionElement): _compared_to_type=self.type, type_=type_, unique=True, - **kw + **kw, ) diff --git a/lib/sqlalchemy/sql/lambdas.py b/lib/sqlalchemy/sql/lambdas.py index da1dbedbb..b2c366671 100644 --- a/lib/sqlalchemy/sql/lambdas.py +++ b/lib/sqlalchemy/sql/lambdas.py @@ -314,7 +314,7 @@ class LambdaElement(elements.ClauseElement): self._resolved = clone( self._resolved, deferred_copy_internals=deferred_copy_internals, - **kw + **kw, ) @util.memoized_property diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index dd8238450..a5fdd39d4 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -680,7 +680,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause): self._init_items( *args, - allow_replacements=extend_existing or keep_existing or autoload + allow_replacements=extend_existing or keep_existing or autoload, ) def _autoload( @@ -1049,7 +1049,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause): schema=schema, comment=self.comment, *args, - **self.kwargs + **self.kwargs, ) for c in self.constraints: if isinstance(c, ForeignKeyConstraint): @@ -1087,7 +1087,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause): for expr in index.expressions ], _table=table, - **index.kwargs + **index.kwargs, ) return self._schema_item_copy(table) @@ -1892,7 +1892,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause): doc=self.doc, comment=self.comment, *args, - **column_kwargs + **column_kwargs, ) return self._schema_item_copy(c) @@ -1930,7 +1930,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause): primary_key=self.primary_key, nullable=self.nullable, _proxies=[self], - *fk + *fk, ) except TypeError as err: raise TypeError( @@ -2007,7 +2007,7 @@ class ForeignKey(DialectKWArgs, SchemaItem): link_to_name=False, match=None, info=None, - **dialect_kw + **dialect_kw, ): r""" Construct a column-level FOREIGN KEY. @@ -2150,7 +2150,7 @@ class ForeignKey(DialectKWArgs, SchemaItem): initially=self.initially, link_to_name=self.link_to_name, match=self.match, - **self._unvalidated_dialect_kw + **self._unvalidated_dialect_kw, ) return self._schema_item_copy(fk) @@ -2421,7 +2421,7 @@ class ForeignKey(DialectKWArgs, SchemaItem): deferrable=self.deferrable, initially=self.initially, match=self.match, - **self._unvalidated_dialect_kw + **self._unvalidated_dialect_kw, ) self.constraint._append_element(column, self) self.constraint._set_parent_with_dispatch(table) @@ -3021,7 +3021,7 @@ class Constraint(DialectKWArgs, SchemaItem): _create_rule=None, info=None, _type_bound=False, - **dialect_kw + **dialect_kw, ): r"""Create a SQL constraint. @@ -3266,7 +3266,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): _copy_expression(expr, self.parent, target_table) for expr in self.columns ], - **constraint_kwargs + **constraint_kwargs, ) return self._schema_item_copy(c) @@ -3314,7 +3314,7 @@ class CheckConstraint(ColumnCollectionConstraint): _create_rule=None, _autoattach=True, _type_bound=False, - **kw + **kw, ): r"""Construct a CHECK constraint. @@ -3358,7 +3358,7 @@ class CheckConstraint(ColumnCollectionConstraint): _type_bound=_type_bound, _autoattach=_autoattach, *columns, - **kw + **kw, ) if table is not None: self._set_parent_with_dispatch(table) @@ -3426,7 +3426,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): match=None, table=None, info=None, - **dialect_kw + **dialect_kw, ): r"""Construct a composite-capable FOREIGN KEY. @@ -3505,7 +3505,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): deferrable=deferrable, initially=initially, info=info, - **dialect_kw + **dialect_kw, ) self.onupdate = onupdate self.ondelete = ondelete @@ -3546,7 +3546,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): match=self.match, deferrable=self.deferrable, initially=self.initially, - **self.dialect_kwargs + **self.dialect_kwargs, ) for refcol in refcolumns ] @@ -4055,7 +4055,7 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): self, *expressions, _column_flag=_column_flag, - _gather_expressions=self.expressions + _gather_expressions=self.expressions, ) if table is not None: @@ -4423,7 +4423,7 @@ class MetaData(SchemaItem): extend_existing=False, autoload_replace=True, resolve_fks=True, - **dialect_kwargs + **dialect_kwargs, ): r"""Load all available table definitions from the database. diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index b53235a83..9c5850761 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -2697,7 +2697,7 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause): whereclause=whereclause, values=values, inline=inline, - **kwargs + **kwargs, ) @util.preload_module("sqlalchemy.sql.dml") @@ -5001,7 +5001,7 @@ class Select( onclause=None, *, isouter=False, - full=False + full=False, ) -> SelfSelect: r"""Create a SQL JOIN against this :class:`_expression.Select` object's criterion @@ -5340,7 +5340,7 @@ class Select( *util.preloaded.sql_util.reduce_columns( self._all_selected_columns, only_synonyms=only_synonyms, - *(self._where_criteria + self._from_obj) + *(self._where_criteria + self._from_obj), ) ) diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index cda7b35cd..cb44fc086 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -926,7 +926,7 @@ class SchemaType(SchemaEventTarget): inherit_schema=self.inherit_schema, metadata=metadata, _create_events=_create_events, - **kw + **kw, ) def create(self, bind, checkfirst=False): |