Skip to content

Commit e629cc8

Browse files
committed
revert unecessary formatting changes
1 parent 55d4b1c commit e629cc8

12 files changed

+22
-21
lines changed

aws_advanced_python_wrapper/blue_green_plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,9 +1156,9 @@ def _update_ip_address_flags(self):
11561156
{host_info.host for host_info in self._start_topology}
11571157
current_topology_copy = self._current_topology
11581158
self._all_topology_changed = (
1159-
current_topology_copy and
1160-
start_topology_hosts and
1161-
all(host_info.host not in start_topology_hosts for host_info in current_topology_copy))
1159+
current_topology_copy and
1160+
start_topology_hosts and
1161+
all(host_info.host not in start_topology_hosts for host_info in current_topology_copy))
11621162

11631163
def _has_all_start_topology_ip_changed(self) -> bool:
11641164
if not self._start_topology:
@@ -1429,7 +1429,7 @@ def _update_corresponding_hosts(self):
14291429
(green_host for green_host in green_hosts
14301430
if self._rds_utils.is_rds_custom_cluster_dns(green_host)
14311431
and custom_cluster_name == self._rds_utils.remove_green_instance_prefix(
1432-
self._rds_utils.get_cluster_id(green_host))),
1432+
self._rds_utils.get_cluster_id(green_host))),
14331433
None
14341434
)
14351435

aws_advanced_python_wrapper/driver_dialect_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class DriverDialectManager(DriverDialectProvider):
5252
}
5353

5454
pool_connection_driver_dialect: Dict[str, str] = {
55-
"SqlAlchemyPooledConnectionProvider": "aws_advanced_python_wrapper.sqlalchemy_driver_dialect.SqlAlchemyDriverDialect",
56-
"SqlAlchemyTortoisePooledConnectionProvider": "aws_advanced_python_wrapper.sqlalchemy_driver_dialect.SqlAlchemyDriverDialect",
55+
"SqlAlchemyPooledConnectionProvider": "aws_advanced_python_wrapper.sqlalchemy_driver_dialect.SqlAlchemyDriverDialect"
5756
}
5857

5958
@staticmethod

aws_advanced_python_wrapper/host_monitoring_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ class MonitoringContext:
207207
This contains each connection's criteria for whether a server should be considered unhealthy.
208208
The context is shared between the main thread and the monitor thread.
209209
"""
210-
211210
def __init__(
212211
self,
213212
monitor: Monitor,

aws_advanced_python_wrapper/host_monitoring_v2_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def _update_host_health_status(
415415

416416
invalid_host_duration_ns = status_check_end_ns - self._invalid_host_start_time_ns
417417
max_invalid_host_duration_ns = (
418-
self._failure_detection_interval_ns * max(0, self._failure_detection_count - 1))
418+
self._failure_detection_interval_ns * max(0, self._failure_detection_count - 1))
419419

420420
if invalid_host_duration_ns >= max_invalid_host_duration_ns:
421421
logger.debug("HostMonitorV2.HostDead", self._host_info.host)

aws_advanced_python_wrapper/mysql_driver_dialect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
from __future__ import annotations
1516

1617
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Set

aws_advanced_python_wrapper/pg_driver_dialect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from __future__ import annotations
1616

17-
from inspect import signature
1817
from typing import TYPE_CHECKING, Any, Callable, Set
1918

2019
import psycopg
@@ -23,6 +22,8 @@
2322
from aws_advanced_python_wrapper.hostinfo import HostInfo
2423
from aws_advanced_python_wrapper.pep249 import Connection
2524

25+
from inspect import signature
26+
2627
from aws_advanced_python_wrapper.driver_dialect import DriverDialect
2728
from aws_advanced_python_wrapper.driver_dialect_codes import DriverDialectCodes
2829
from aws_advanced_python_wrapper.errors import UnsupportedOperationError

aws_advanced_python_wrapper/sqlalchemy_driver_dialect.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,21 @@
1616

1717
from typing import TYPE_CHECKING, Any
1818

19+
from aws_advanced_python_wrapper.driver_dialect import DriverDialect
20+
from aws_advanced_python_wrapper.errors import AwsWrapperError
21+
from aws_advanced_python_wrapper.utils.messages import Messages
22+
1923
if TYPE_CHECKING:
2024
from aws_advanced_python_wrapper.hostinfo import HostInfo
2125
from aws_advanced_python_wrapper.pep249 import Connection
2226
from aws_advanced_python_wrapper.utils.properties import Properties
2327

2428
from sqlalchemy import PoolProxiedConnection
2529

26-
from aws_advanced_python_wrapper.driver_dialect import DriverDialect
27-
from aws_advanced_python_wrapper.errors import AwsWrapperError
28-
from aws_advanced_python_wrapper.utils.messages import Messages
29-
3030

3131
class SqlAlchemyDriverDialect(DriverDialect):
3232
_driver_name: str = "SQLAlchemy"
3333
TARGET_DRIVER_CODE: str = "sqlalchemy"
34-
_underlying_driver_dialect = None
3534

3635
def __init__(self, underlying_driver: DriverDialect, props: Properties):
3736
super().__init__(props)

tests/integration/container/utils/connection_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def get_aws_tortoise_url(
109109
dbname: Optional[str] = None,
110110
**kwargs) -> str:
111111
"""Build AWS MySQL connection URL for Tortoise ORM with query parameters."""
112-
host = self.writer_cluster_host if host is None else host
112+
113+
env_host = self.writer_cluster_host if self.writer_cluster_host else self.writer_host
114+
host = env_host if host is None else host
113115
port = self.port if port is None else port
114116
user = self.user if user is None else user
115117
password = self.password if password is None else password

tests/integration/container/utils/test_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def is_test_driver_allowed(self, test_driver: TestDriver) -> bool:
240240
disabled_by_feature = TestEnvironmentFeatures.SKIP_MYSQL_DRIVER_TESTS in features
241241
elif test_driver == TestDriver.PG:
242242
driver_compatible_to_database_engine = (
243-
database_engine == DatabaseEngine.PG)
243+
database_engine == DatabaseEngine.PG)
244244
disabled_by_feature = TestEnvironmentFeatures.SKIP_PG_DRIVER_TESTS in features
245245
else:
246246
raise UnsupportedOperationError(test_driver.value)

tests/integration/container/utils/test_environment_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, request: Dict[str, Any]) -> None:
4040
self._instances = getattr(DatabaseInstances, typing.cast('str', request.get("instances")))
4141
self._deployment = getattr(DatabaseEngineDeployment, typing.cast('str', request.get("deployment")))
4242
self._target_python_version = getattr(TargetPythonVersion, typing.cast('str', request.get("targetPythonVersion")))
43-
self._num_of_instances = request.get("numOfInstances", 1)
43+
self._num_of_instances = typing.cast('int', request.get("numOfInstances"))
4444
self._features = set()
4545
features: Iterable[str] = typing.cast('Iterable[str]', request.get("features"))
4646
if features is not None:

0 commit comments

Comments
 (0)