Skip to content

Commit 84dfa0b

Browse files
committed
chore: updates linting, predominantly import order
1 parent 88ae19a commit 84dfa0b

32 files changed

Lines changed: 137 additions & 129 deletions

packages/sqlalchemy-bigquery/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# All configuration values have a default; values that are commented out
2525
# serve to show the default.
2626

27-
import sys
2827
import os
2928
import shlex
29+
import sys
3030

3131
# If extensions (or modules to document with autodoc) are in another directory,
3232
# add these directories to sys.path here. If the directory is relative to the

packages/sqlalchemy-bigquery/noxfile.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@
4343

4444
DEFAULT_PYTHON_VERSION = "3.14"
4545

46-
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
46+
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
47+
"3.8",
48+
"3.9",
49+
"3.10",
50+
"3.11",
51+
"3.12",
52+
"3.13",
53+
"3.14",
54+
]
4755
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
4856
ALL_PYTHON.extend(["3.7"])
4957
UNIT_TEST_STANDARD_DEPENDENCIES = [
@@ -219,7 +227,7 @@ def lint_setup_py(session):
219227
session.install("docutils", "pygments", "setuptools")
220228

221229
session.run("python", "-m", "pip", "freeze")
222-
230+
223231
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
224232

225233

@@ -351,7 +359,9 @@ def system(session):
351359
system_test_folder_path = os.path.join("tests", "system")
352360

353361
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
354-
session.skip("Credentials must be set via environment variable GOOGLE_APPLICATION_CREDENTIALS")
362+
session.skip(
363+
"Credentials must be set via environment variable GOOGLE_APPLICATION_CREDENTIALS"
364+
)
355365

356366
# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
357367
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
@@ -400,7 +410,9 @@ def system_noextras(session):
400410
system_test_folder_path = os.path.join("tests", "system")
401411

402412
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
403-
session.skip("Credentials must be set via environment variable GOOGLE_APPLICATION_CREDENTIALS")
413+
session.skip(
414+
"Credentials must be set via environment variable GOOGLE_APPLICATION_CREDENTIALS"
415+
)
404416

405417
# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
406418
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":

packages/sqlalchemy-bigquery/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import itertools
2323
import os
2424
import re
25+
2526
import setuptools
2627
from setuptools import setup
2728

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323
import warnings
2424

25-
from .version import __version__
26-
27-
from .base import BigQueryDialect, dialect
25+
from . import _versions_helpers
2826
from ._types import (
2927
ARRAY,
3028
BIGNUMERIC,
@@ -44,8 +42,8 @@
4442
TIME,
4543
TIMESTAMP,
4644
)
47-
48-
from . import _versions_helpers
45+
from .base import BigQueryDialect, dialect
46+
from .version import __version__
4947

5048
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
5149

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# license that can be found in the LICENSE file or at
55
# https://opensource.org/licenses/MIT.
66

7+
import base64
78
import functools
9+
import json
810
import re
911
from typing import Optional
1012

@@ -13,9 +15,6 @@
1315
from google.cloud import bigquery
1416
from google.oauth2 import service_account
1517
import sqlalchemy
16-
import base64
17-
import json
18-
1918

2019
USER_AGENT_TEMPLATE = "sqlalchemy/{}"
2120
SCOPES = (

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_struct.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1818
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919

20+
from sqlalchemy.sql import operators
21+
import sqlalchemy.sql.coercions
2022
import sqlalchemy.sql.default_comparator
23+
import sqlalchemy.sql.roles
2124
import sqlalchemy.sql.sqltypes
2225
import sqlalchemy.types
23-
from sqlalchemy.sql import operators
2426

2527
from . import base
2628

27-
import sqlalchemy.sql.coercions
28-
import sqlalchemy.sql.roles
29-
3029

3130
def _get_subtype_col_spec(type_):
3231
global _get_subtype_col_spec
@@ -114,7 +113,6 @@ def _field_index(self, name, operator):
114113
)
115114

116115

117-
118116
class SQLCompiler:
119117
def visit_json_getitem_op_binary(self, binary, operator_, **kw):
120118
left = self.process(binary.left, **kw)

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1818
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919

20+
from google.cloud.bigquery.schema import SchemaField
2021
import sqlalchemy.types
2122
import sqlalchemy.util
2223

23-
from google.cloud.bigquery.schema import SchemaField
24-
2524
try:
2625
from .geography import GEOGRAPHY
2726
except ImportError: # pragma: NO COVER

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/base.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,45 @@
2121

2222
import datetime
2323
from decimal import Decimal
24-
import random
2524
import operator
25+
import random
26+
import re
2627
import uuid
2728

2829
from google import auth
2930
import google.api_core.exceptions
30-
from google.cloud.bigquery import dbapi, ConnectionProperty
31+
from google.api_core.exceptions import NotFound
32+
from google.cloud.bigquery import ConnectionProperty, QueryJobConfig, dbapi
3133
from google.cloud.bigquery.table import (
3234
RangePartitioning,
3335
TableReference,
3436
TimePartitioning,
3537
)
36-
from google.api_core.exceptions import NotFound
3738
import packaging.version
3839
import sqlalchemy
39-
import sqlalchemy.sql.expression
40-
import sqlalchemy.sql.functions
41-
import sqlalchemy.sql.sqltypes
42-
import sqlalchemy.sql.type_api
43-
from sqlalchemy.exc import NoSuchTableError, NoSuchColumnError
4440
from sqlalchemy import util
41+
from sqlalchemy.engine.base import Engine
42+
from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext
43+
from sqlalchemy.exc import NoSuchColumnError, NoSuchTableError
4544
from sqlalchemy.ext.compiler import compiles
45+
from sqlalchemy.sql import elements, selectable
4646
from sqlalchemy.sql.compiler import (
47-
SQLCompiler,
48-
GenericTypeCompiler,
4947
DDLCompiler,
48+
GenericTypeCompiler,
5049
IdentifierPreparer,
50+
SQLCompiler,
5151
)
52-
from sqlalchemy.sql.sqltypes import Integer, String, NullType, Numeric
53-
from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext
54-
from sqlalchemy.engine.base import Engine
55-
from sqlalchemy.sql.schema import Column
56-
from sqlalchemy.sql.schema import Table
52+
import sqlalchemy.sql.expression
53+
import sqlalchemy.sql.functions
54+
from sqlalchemy.sql.schema import Column, Table
5755
from sqlalchemy.sql.selectable import CTE
58-
from sqlalchemy.sql import elements, selectable
59-
import re
56+
import sqlalchemy.sql.sqltypes
57+
from sqlalchemy.sql.sqltypes import Integer, NullType, Numeric, String
58+
import sqlalchemy.sql.type_api
59+
import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base as vendored_postgresql
6060

61-
from .parse_url import parse_url
6261
from . import _helpers, _struct, _types
63-
import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base as vendored_postgresql
64-
from google.cloud.bigquery import QueryJobConfig
62+
from .parse_url import parse_url
6563

6664
# Illegal characters is intended to be all characters that are not explicitly
6765
# allowed as part of the flexible column names.
@@ -1409,10 +1407,10 @@ def __init__(self, *args, **kwargs):
14091407
from alembic.ddl.base import (
14101408
ColumnName,
14111409
ColumnType,
1410+
alter_column,
1411+
alter_table,
14121412
format_column_name,
14131413
format_type,
1414-
alter_table,
1415-
alter_column,
14161414
)
14171415

14181416
class SqlalchemyBigqueryImpl(impl.DefaultImpl):

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/geography.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919

2020
import geoalchemy2
21-
from geoalchemy2.shape import to_shape
2221
import geoalchemy2.functions
22+
from geoalchemy2.shape import to_shape
2323
from shapely import wkb, wkt
2424
import sqlalchemy.ext.compiler
2525
from sqlalchemy.sql.elements import BindParameter

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/parse_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
from google.cloud.bigquery.dataset import DatasetReference
2424
from google.cloud.bigquery.job import (
2525
CreateDisposition,
26-
WriteDisposition,
2726
QueryPriority,
2827
SchemaUpdateOption,
28+
WriteDisposition,
2929
)
3030
from google.cloud.bigquery.table import EncryptionConfiguration, TableReference
3131

0 commit comments

Comments
 (0)