def process(value):
return f"""'{
- value.replace("-", "").replace("'", "''")
- }'"""
+ value.replace("-", "").replace("'", "''")
+ }'"""
return process
# see #9511
dbapi_type = sqltypes.STRINGTYPE
return f"""{sqltext}::{
- self.dialect.type_compiler_instance.process(
- dbapi_type, identifier_preparer=self.preparer
- )
- }"""
+ self.dialect.type_compiler_instance.process(
+ dbapi_type, identifier_preparer=self.preparer
+ )
+ }"""
def visit_array(self, element, **kw):
return "ARRAY[%s]" % self.visit_clauselist(element, **kw)
cursor = dbapi_connection.cursor()
cursor.execute(
f"""SET CLIENT_ENCODING TO '{
- client_encoding.replace("'", "''")
- }'"""
+ client_encoding.replace("'", "''")
+ }'"""
)
cursor.execute("COMMIT")
cursor.close()
if self._echo:
self._log_info(sql_util._long_statement(sub_stmt))
- imv_stats = f""" {
- imv_batch.batchnum}/{imv_batch.total_batches} ({
- 'ordered'
- if imv_batch.rows_sorted else 'unordered'
- }{
- '; batch not supported'
- if imv_batch.is_downgraded
- else ''
- })"""
+ imv_stats = f""" {imv_batch.batchnum}/{
+ imv_batch.total_batches
+ } ({
+ 'ordered'
+ if imv_batch.rows_sorted else 'unordered'
+ }{
+ '; batch not supported'
+ if imv_batch.is_downgraded
+ else ''
+ })"""
if imv_batch.batchnum == 1:
stats += imv_stats
if not expressions:
util.warn(
f"Skipping {flavor} {name!r} because key "
- f"{index+1} reflected as None but no "
+ f"{index + 1} reflected as None but no "
"'expressions' were returned"
)
break
raise sa_exc.InvalidRequestError(
"Can't apply uniqueness to row tuple containing value of "
- f"""type {datatype!r}; {'the values returned appear to be'
- if uncertain else 'this datatype produces'} """
- "non-hashable values"
+ f"""type {datatype!r}; {
+ 'the values returned appear to be'
+ if uncertain
+ else 'this datatype produces'
+ } non-hashable values"""
)
return go
f"No primary key value supplied for column(s) "
f"""{
', '.join(
- str(c) for c in pks if pk_params[c._label] is None)
+ str(c) for c in pks if pk_params[c._label] is None
+ )
}; """
"per-row ORM Bulk UPDATE by Primary Key requires that "
"records contain primary key values",
f"Mapped class {path[0]} does not apply to any of the "
f"root entities in this query, e.g. "
f"""{
- ", ".join(str(x.entity_zero)
- for x in mapper_entities if x.entity_zero
- )}. Please """
+ ", ".join(
+ str(x.entity_zero)
+ for x in mapper_entities if x.entity_zero
+ )}. Please """
"specify the full path "
"from one of the root entities to the target "
"attribute. "
):
"""test #8035"""
- tname = f"##foo{random.randint(1,1000000)}"
+ tname = f"##foo{random.randint(1, 1000000)}"
with temp_db_alt_collation_fixture.connect() as conn:
conn.exec_driver_sql(f"CREATE TABLE {tname} (id int primary key)")
for attr in attributes:
r_attr = getattr(reflected_type, attr)
e_attr = getattr(expected_spec, attr)
- col = f"c{i+1}"
+ col = f"c{i + 1}"
eq_(
r_attr,
e_attr,
@event.listens_for(p, "reset")
def reset(conn, rec, state):
canary.append(
- f"""reset_{'rollback_ok'
- if state.asyncio_safe else 'no_rollback'}"""
+ f"""reset_{
+ 'rollback_ok'
+ if state.asyncio_safe else 'no_rollback'
+ }"""
)
@event.listens_for(p, "checkin")
sa_exc.InvalidRequestError,
r"Can't apply uniqueness to row tuple "
r"containing value of type MyType\(\); "
- rf"""{'the values returned appear to be'
- if uncertain else 'this datatype produces'} """
+ rf"""{
+ 'the values returned appear to be'
+ if uncertain else 'this datatype produces'
+ } """
r"non-hashable values",
):
result = s.execute(q).unique().all()
args.append(sa.ForeignKey(f"table_{target}.table_{target}_col_1"))
cols.append(
sa.Column(
- f"table_{table_num}_col_{i+1}",
+ f"table_{table_num}_col_{i + 1}",
*args,
primary_key=i == 0,
comment=f"primary key of table_{table_num}"
collection_cls(r),
collection_cls(
[
- (uuids[i], f"d{i+1}", "some_server_default")
+ (uuids[i], f"d{i + 1}", "some_server_default")
for i in range(5)
]
),
collection_cls(
[
(
- f"d{i+1}",
+ f"d{i + 1}",
"some_server_default",
)
for i in range(5)
[testenv:lint]
basepython = python3
deps=
- flake8==6.0.0
+ flake8==6.1.0
flake8-import-order
flake8-builtins
flake8-future-annotations>=0.0.5