Skip to content

Commit 748bf71

Browse files
committed
Source base cleanups
in trying to apply 2020 copyright to files, the pre-commit hooks complain about random file issues. - remove old corrections.py utility, this had something to do with repairing refs in the sphinx docs - run pre commit hooks on all files - formatting adjustments to work around code formatting collisions (long import lines that zimports can't rewrite correctly) Change-Id: I260744866f69e902eb93665c7c728ee94d3371a2
1 parent 4e7c789 commit 748bf71

File tree

10 files changed

+21
-67
lines changed

10 files changed

+21
-67
lines changed

doc/build/corrections.py

-39
This file was deleted.

lib/sqlalchemy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
from .schema import CheckConstraint # noqa
1212
from .schema import Column # noqa
1313
from .schema import ColumnDefault # noqa
14+
from .schema import Computed # noqa
1415
from .schema import Constraint # noqa
1516
from .schema import DDL # noqa
1617
from .schema import DefaultClause # noqa
1718
from .schema import FetchedValue # noqa
1819
from .schema import ForeignKey # noqa
1920
from .schema import ForeignKeyConstraint # noqa
20-
from .schema import Computed # noqa
2121
from .schema import Index # noqa
2222
from .schema import MetaData # noqa
2323
from .schema import PrimaryKeyConstraint # noqa

lib/sqlalchemy/dialects/mysql/oursql.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ def _show_create_table(
181181
):
182182
return MySQLDialect._show_create_table(
183183
self,
184-
connection.connect(
185-
close_with_result=True
186-
).execution_options(_oursql_plain_query=True),
184+
connection.connect(close_with_result=True).execution_options(
185+
_oursql_plain_query=True
186+
),
187187
table,
188188
charset,
189189
full_name,

lib/sqlalchemy/dialects/mysql/pyodbc.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ def on_connect(conn):
119119
pyodbc_SQL_CHAR = 1 # pyodbc.SQL_CHAR
120120
pyodbc_SQL_WCHAR = -8 # pyodbc.SQL_WCHAR
121121
if sys.version_info.major > 2:
122-
conn.setdecoding(pyodbc_SQL_CHAR, encoding='utf-8')
123-
conn.setdecoding(pyodbc_SQL_WCHAR, encoding='utf-8')
124-
conn.setencoding(encoding='utf-8')
122+
conn.setdecoding(pyodbc_SQL_CHAR, encoding="utf-8")
123+
conn.setdecoding(pyodbc_SQL_WCHAR, encoding="utf-8")
124+
conn.setencoding(encoding="utf-8")
125125
else:
126-
conn.setdecoding(pyodbc_SQL_CHAR, encoding='utf-8')
127-
conn.setdecoding(pyodbc_SQL_WCHAR, encoding='utf-8')
128-
conn.setencoding(str, encoding='utf-8')
129-
conn.setencoding(unicode, encoding='utf-8')
126+
conn.setdecoding(pyodbc_SQL_CHAR, encoding="utf-8")
127+
conn.setdecoding(pyodbc_SQL_WCHAR, encoding="utf-8")
128+
conn.setencoding(str, encoding="utf-8")
129+
conn.setencoding(unicode, encoding="utf-8")
130130

131131
return on_connect
132132

lib/sqlalchemy/schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
from .sql.schema import ColumnCollectionConstraint # noqa
4242
from .sql.schema import ColumnCollectionMixin # noqa
4343
from .sql.schema import ColumnDefault # noqa
44+
from .sql.schema import Computed # noqa
4445
from .sql.schema import Constraint # noqa
4546
from .sql.schema import DefaultClause # noqa
4647
from .sql.schema import DefaultGenerator # noqa
4748
from .sql.schema import FetchedValue # noqa
4849
from .sql.schema import ForeignKey # noqa
4950
from .sql.schema import ForeignKeyConstraint # noqa
50-
from .sql.schema import Computed # noqa
5151
from .sql.schema import Index # noqa
5252
from .sql.schema import MetaData # noqa
5353
from .sql.schema import PrimaryKeyConstraint # noqa

lib/sqlalchemy/sql/ddl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def visit_table(
715715
CreateTable(
716716
table,
717717
include_foreign_key_constraints= # noqa
718-
include_foreign_key_constraints,
718+
include_foreign_key_constraints, # noqa
719719
)
720720
# fmt: on
721721
)

lib/sqlalchemy/testing/engines.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,7 @@ def print_sql():
303303
d = engine.dialect
304304
return "\n".join(str(s.compile(dialect=d)) for s in engine.mock)
305305

306-
engine = create_mock_engine(
307-
dialect_name + "://", executor
308-
)
306+
engine = create_mock_engine(dialect_name + "://", executor)
309307
assert not hasattr(engine, "mock")
310308
engine.mock = buffer
311309
engine.assert_sql = assert_sql

reap_dbs.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@
2020
logging.getLogger(provision.__name__).setLevel(logging.INFO)
2121

2222
provision.reap_dbs(sys.argv[1])
23-
24-

test/ext/test_deprecations.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
from sqlalchemy import testing
22
from sqlalchemy.orm import mapper
3+
from . import test_mutable
34
from .test_mutable import Foo
4-
from .test_mutable import (
5-
MutableAssociationScalarPickleTest as _MutableAssociationScalarPickleTest,
6-
)
7-
from .test_mutable import (
8-
MutableWithScalarJSONTest as _MutableWithScalarJSONTest,
9-
)
105

116

12-
class MutableIncludeNonPrimaryTest(_MutableWithScalarJSONTest):
7+
class MutableIncludeNonPrimaryTest(test_mutable.MutableWithScalarJSONTest):
138
@classmethod
149
def setup_mappers(cls):
1510
foo = cls.tables.foo
@@ -23,7 +18,9 @@ def setup_mappers(cls):
2318
)
2419

2520

26-
class MutableAssocIncludeNonPrimaryTest(_MutableAssociationScalarPickleTest):
21+
class MutableAssocIncludeNonPrimaryTest(
22+
test_mutable.MutableAssociationScalarPickleTest
23+
):
2724
@classmethod
2825
def setup_mappers(cls):
2926
foo = cls.tables.foo

test/sql/test_cte.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -918,11 +918,11 @@ def test_prefixes(self):
918918

919919
self.assert_compile(
920920
stmt,
921-
'WITH regional_sales AS NOT MATERIALIZED '
921+
"WITH regional_sales AS NOT MATERIALIZED "
922922
'(SELECT "order"."order" AS "order" '
923923
'FROM "order") SELECT "order"."order" FROM "order", '
924924
'regional_sales WHERE "order"."order" > regional_sales."order"',
925-
dialect="postgresql"
925+
dialect="postgresql",
926926
)
927927

928928
def test_suffixes(self):

0 commit comments

Comments
 (0)