Skip to content

Commit

Permalink
chore: [autoapprove] Update black and isort to latest versions (#…
Browse files Browse the repository at this point in the history
…1020)

Source-Link: googleapis/synthtool@0c7b033
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 10, 2023
1 parent d0e4ffc commit e9c6e27
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb
# created: 2023-10-02T21:31:03.517640371Z
digest: sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547
# created: 2023-10-09T14:06:13.397766266Z
6 changes: 3 additions & 3 deletions .kokoro/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ typing-extensions==4.4.0 \
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
# via -r requirements.in
urllib3==1.26.12 \
--hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \
--hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997
urllib3==1.26.17 \
--hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \
--hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b
# via
# requests
# twine
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:

r"""Call the cancel operation method over HTTP.
Args:
Expand Down Expand Up @@ -3258,7 +3257,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:

r"""Call the delete operation method over HTTP.
Args:
Expand Down Expand Up @@ -3333,7 +3331,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operations_pb2.Operation:

r"""Call the get operation method over HTTP.
Args:
Expand Down Expand Up @@ -3412,7 +3409,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operations_pb2.ListOperationsResponse:

r"""Call the list operations method over HTTP.
Args:
Expand Down
1 change: 0 additions & 1 deletion google/cloud/spanner_v1/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ def execute_partitioned_dml(

def execute_pdml():
with SessionCheckout(self._pool) as session:

txn = api.begin_transaction(
session=session.name, options=txn_options, metadata=metadata
)
Expand Down
1 change: 0 additions & 1 deletion google/cloud/spanner_v1/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ def _delay_until_retry(exc, deadline, attempts):

delay = _get_retry_delay(cause, attempts)
if delay is not None:

if now + delay > deadline:
raise

Expand Down
36 changes: 19 additions & 17 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,50 @@
# Generated by synthtool. DO NOT EDIT!

from __future__ import absolute_import

import os
import pathlib
import re
import shutil
from typing import Dict, List
import warnings

import nox

FLAKE8_VERSION = "flake8==6.1.0"
BLACK_VERSION = "black==22.3.0"
ISORT_VERSION = "isort==5.10.1"
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.8"

UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
"pytest",
"pytest-cov",
"pytest-asyncio",
]
UNIT_TEST_EXTERNAL_DEPENDENCIES = []
UNIT_TEST_LOCAL_DEPENDENCIES = []
UNIT_TEST_DEPENDENCIES = []
UNIT_TEST_EXTRAS = []
UNIT_TEST_EXTRAS_BY_PYTHON = {}

SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
UNIT_TEST_DEPENDENCIES: List[str] = []
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = []
SYSTEM_TEST_LOCAL_DEPENDENCIES = []
SYSTEM_TEST_DEPENDENCIES = []
SYSTEM_TEST_EXTRAS = [
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
SYSTEM_TEST_DEPENDENCIES: List[str] = []
SYSTEM_TEST_EXTRAS: List[str] = [
"tracing",
]
SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand All @@ -71,6 +73,7 @@
"lint_setup_py",
"blacken",
"docs",
"format",
]

# Error if a python version is missing
Expand Down Expand Up @@ -210,7 +213,6 @@ def unit(session):


def install_systemtest_dependencies(session, *constraints):

# Use pre-release gRPC for system tests.
# Exclude version 1.52.0rc1 which has a known issue.
# See https://github.com/grpc/grpc/issues/32163
Expand Down
1 change: 0 additions & 1 deletion tests/system/_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def _check_row_data(row_data, expected, recurse_into_lists=True):


def _check_cell_data(found_cell, expected_cell, recurse_into_lists=True):

if isinstance(found_cell, datetime_helpers.DatetimeWithNanoseconds):
_assert_timestamp(expected_cell, found_cell)

Expand Down
1 change: 0 additions & 1 deletion tests/system/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def instance_configs(spanner_client):
configs = list(_helpers.retry_503(spanner_client.list_instance_configs)())

if not _helpers.USE_EMULATOR:

# Defend against back-end returning configs for regions we aren't
# actually allowed to use.
configs = [config for config in configs if "-us-" in config.name]
Expand Down
1 change: 0 additions & 1 deletion tests/system/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def clear_table(transaction):

@pytest.fixture(scope="function")
def dbapi_database(raw_database):

raw_database.run_in_transaction(clear_table)

yield raw_database
Expand Down
10 changes: 0 additions & 10 deletions tests/system/test_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ def assert_span_attributes(


def _make_attributes(db_instance, **kwargs):

attributes = {
"db.type": "spanner",
"db.url": "spanner.googleapis.com",
Expand Down Expand Up @@ -1099,7 +1098,6 @@ def test_transaction_batch_update_w_parent_span(
)

def unit_of_work(transaction):

status, row_counts = transaction.batch_update(
[insert_statement, update_statement, delete_statement]
)
Expand Down Expand Up @@ -1303,7 +1301,6 @@ def _row_data(max_index):


def _set_up_table(database, row_count):

sd = _sample_data

def _unit_of_work(transaction):
Expand Down Expand Up @@ -1430,7 +1427,6 @@ def test_multiuse_snapshot_read_isolation_read_timestamp(sessions_database):
with sessions_database.snapshot(
read_timestamp=committed, multi_use=True
) as read_ts:

before = list(read_ts.read(sd.TABLE, sd.COLUMNS, sd.ALL))
sd._check_row_data(before, all_data_rows)

Expand All @@ -1452,7 +1448,6 @@ def test_multiuse_snapshot_read_isolation_exact_staleness(sessions_database):
delta = datetime.timedelta(microseconds=1000)

with sessions_database.snapshot(exact_staleness=delta, multi_use=True) as exact:

before = list(exact.read(sd.TABLE, sd.COLUMNS, sd.ALL))
sd._check_row_data(before, all_data_rows)

Expand Down Expand Up @@ -1945,7 +1940,6 @@ def test_multiuse_snapshot_execute_sql_isolation_strong(sessions_database):
all_data_rows = list(_row_data(row_count))

with sessions_database.snapshot(multi_use=True) as strong:

before = list(strong.execute_sql(sd.SQL))
sd._check_row_data(before, all_data_rows)

Expand Down Expand Up @@ -2005,7 +1999,6 @@ def test_invalid_type(sessions_database):


def test_execute_sql_select_1(sessions_database):

sessions_database.snapshot(multi_use=True)

# Hello, world query
Expand Down Expand Up @@ -2175,7 +2168,6 @@ def test_execute_sql_w_bytes_bindings(sessions_database, database_dialect):


def test_execute_sql_w_timestamp_bindings(sessions_database, database_dialect):

timestamp_1 = datetime_helpers.DatetimeWithNanoseconds(
1989, 1, 17, 17, 59, 12, nanosecond=345612789
)
Expand Down Expand Up @@ -2462,7 +2454,6 @@ def test_execute_sql_w_query_param_struct(sessions_database, not_postgres):


def test_execute_sql_returning_transfinite_floats(sessions_database, not_postgres):

with sessions_database.snapshot(multi_use=True) as snapshot:
# Query returning -inf, +inf, NaN as column values
rows = list(
Expand Down Expand Up @@ -2537,7 +2528,6 @@ def details(self):

def _check_batch_status(status_code, expected=code_pb2.OK):
if status_code != expected:

_status_code_to_grpc_status_code = {
member.value[0]: member for member in grpc.StatusCode
}
Expand Down
9 changes: 0 additions & 9 deletions tests/unit/spanner_dbapi/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class TestCursor(unittest.TestCase):

INSTANCE = "test-instance"
DATABASE = "test-database"

Expand Down Expand Up @@ -917,7 +916,6 @@ def test_fetchone_retry_aborted(self, mock_client):
with mock.patch(
"google.cloud.spanner_dbapi.connection.Connection.retry_transaction"
) as retry_mock:

cursor.fetchone()

retry_mock.assert_called_with()
Expand Down Expand Up @@ -948,7 +946,6 @@ def test_fetchone_retry_aborted_statements(self, mock_client):
"google.cloud.spanner_dbapi.connection.Connection.run_statement",
return_value=([row], ResultsChecksum()),
) as run_mock:

cursor.fetchone()

run_mock.assert_called_with(statement, retried=True)
Expand Down Expand Up @@ -982,7 +979,6 @@ def test_fetchone_retry_aborted_statements_checksums_mismatch(self, mock_client)
"google.cloud.spanner_dbapi.connection.Connection.run_statement",
return_value=([row2], ResultsChecksum()),
) as run_mock:

with self.assertRaises(RetryAborted):
cursor.fetchone()

Expand All @@ -1007,7 +1003,6 @@ def test_fetchall_retry_aborted(self, mock_client):
with mock.patch(
"google.cloud.spanner_dbapi.connection.Connection.retry_transaction"
) as retry_mock:

cursor.fetchall()

retry_mock.assert_called_with()
Expand Down Expand Up @@ -1071,7 +1066,6 @@ def test_fetchall_retry_aborted_statements_checksums_mismatch(self, mock_client)
"google.cloud.spanner_dbapi.connection.Connection.run_statement",
return_value=([row2], ResultsChecksum()),
) as run_mock:

with self.assertRaises(RetryAborted):
cursor.fetchall()

Expand All @@ -1096,7 +1090,6 @@ def test_fetchmany_retry_aborted(self, mock_client):
with mock.patch(
"google.cloud.spanner_dbapi.connection.Connection.retry_transaction"
) as retry_mock:

cursor.fetchmany()

retry_mock.assert_called_with()
Expand Down Expand Up @@ -1127,7 +1120,6 @@ def test_fetchmany_retry_aborted_statements(self, mock_client):
"google.cloud.spanner_dbapi.connection.Connection.run_statement",
return_value=([row], ResultsChecksum()),
) as run_mock:

cursor.fetchmany(len(row))

run_mock.assert_called_with(statement, retried=True)
Expand Down Expand Up @@ -1161,7 +1153,6 @@ def test_fetchmany_retry_aborted_statements_checksums_mismatch(self, mock_client
"google.cloud.spanner_dbapi.connection.Connection.run_statement",
return_value=([row2], ResultsChecksum()),
) as run_mock:

with self.assertRaises(RetryAborted):
cursor.fetchmany(len(row))

Expand Down
3 changes: 1 addition & 2 deletions tests/unit/spanner_dbapi/test_parse_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class TestParseUtils(unittest.TestCase):

skip_condition = sys.version_info[0] < 3
skip_message = "Subtests are not supported in Python 2"

Expand Down Expand Up @@ -112,7 +111,7 @@ def test_sql_pyformat_args_to_spanner(self):
("SELECT * from t WHERE id=10", {"f1": "app", "f2": "name"}),
),
]
for ((sql_in, params), sql_want) in cases:
for (sql_in, params), sql_want in cases:
with self.subTest(sql=sql_in):
got_sql, got_named_args = sql_pyformat_args_to_spanner(sql_in, params)
want_sql, want_named_args = sql_want
Expand Down
1 change: 0 additions & 1 deletion tests/unit/spanner_dbapi/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class TestParser(unittest.TestCase):

skip_condition = sys.version_info[0] < 3
skip_message = "Subtests are not supported in Python 2"

Expand Down
1 change: 0 additions & 1 deletion tests/unit/spanner_dbapi/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class TestTypes(unittest.TestCase):

TICKS = 1572822862.9782631 + timezone # Sun 03 Nov 2019 23:14:22 UTC

def test__date_from_ticks(self):
Expand Down
1 change: 0 additions & 1 deletion tests/unit/spanner_dbapi/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class TestUtils(unittest.TestCase):

skip_condition = sys.version_info[0] < 3
skip_message = "Subtests are not supported in Python 2"

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class _BaseTest(unittest.TestCase):

PROJECT_ID = "project-id"
INSTANCE_ID = "instance-id"
INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID
Expand Down Expand Up @@ -426,7 +425,6 @@ class _Database(object):


class _FauxSpannerAPI:

_create_instance_conflict = False
_instance_not_found = False
_committed = None
Expand Down
Loading

0 comments on commit e9c6e27

Please sign in to comment.