Skip to content

Commit 75164e6

Browse files
committed
rename path to backends instead of backend
1 parent ae32595 commit 75164e6

File tree

12 files changed

+16
-15
lines changed

12 files changed

+16
-15
lines changed

aws_advanced_python_wrapper/sql_alchemy_connection_provider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def accepts_host_info(self, host_info: HostInfo, props: Properties) -> bool:
8888
if self._accept_url_func:
8989
return self._accept_url_func(host_info, props)
9090
url_type = SqlAlchemyPooledConnectionProvider._rds_utils.identify_rds_type(host_info.host)
91-
return url_type in (RdsUrlType.RDS_INSTANCE, RdsUrlType.RDS_WRITER_CLUSTER)
91+
return RdsUrlType.RDS_INSTANCE == url_type
9292

9393
def accepts_strategy(self, role: HostRole, strategy: str) -> bool:
9494
return strategy == SqlAlchemyPooledConnectionProvider._LEAST_CONNECTIONS or strategy in self._accepted_strategies
@@ -137,6 +137,7 @@ def connect(
137137

138138
if queue_pool is None:
139139
raise AwsWrapperError(Messages.get_formatted("SqlAlchemyPooledConnectionProvider.PoolNone", host_info.url))
140+
140141
return queue_pool.connect()
141142

142143
# The pool key should always be retrieved using this method, because the username

aws_advanced_python_wrapper/tortoise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Register AWS MySQL backend
1818
DB_LOOKUP["aws-mysql"] = {
19-
"engine": "aws_advanced_python_wrapper.tortoise.backend.mysql",
19+
"engine": "aws_advanced_python_wrapper.tortoise.backends.mysql",
2020
"vmap": {
2121
"path": "database",
2222
"hostname": "host",

aws_advanced_python_wrapper/tortoise/backend/mysql/client.py renamed to aws_advanced_python_wrapper/tortoise/backends/mysql/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
OperationalError, TransactionManagementError)
3131

3232
from aws_advanced_python_wrapper.errors import AwsWrapperError, FailoverError
33-
from aws_advanced_python_wrapper.tortoise.backend.base.client import (
33+
from aws_advanced_python_wrapper.tortoise.backends.base.client import (
3434
AwsBaseDBAsyncClient, AwsConnectionAsyncWrapper, AwsTransactionalDBClient,
3535
TortoiseAwsClientConnectionWrapper, TortoiseAwsClientTransactionContext)
36-
from aws_advanced_python_wrapper.tortoise.backend.mysql.executor import \
36+
from aws_advanced_python_wrapper.tortoise.backends.mysql.executor import \
3737
AwsMySQLExecutor
38-
from aws_advanced_python_wrapper.tortoise.backend.mysql.schema_generator import \
38+
from aws_advanced_python_wrapper.tortoise.backends.mysql.schema_generator import \
3939
AwsMySQLSchemaGenerator
4040
from aws_advanced_python_wrapper.utils.log import Logger
4141

tests/integration/container/tortoise/test_tortoise_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def setup_tortoise_dict_config(self, conn_utils):
4848
config = {
4949
"connections": {
5050
"default": {
51-
"engine": "aws_advanced_python_wrapper.tortoise.backend.mysql",
51+
"engine": "aws_advanced_python_wrapper.tortoise.backends.mysql",
5252
"credentials": {
5353
"host": conn_utils.writer_cluster_host,
5454
"port": conn_utils.port,
@@ -87,7 +87,7 @@ async def setup_tortoise_multi_db(self, conn_utils):
8787
config = {
8888
"connections": {
8989
"default": {
90-
"engine": "aws_advanced_python_wrapper.tortoise.backend.mysql",
90+
"engine": "aws_advanced_python_wrapper.tortoise.backends.mysql",
9191
"credentials": {
9292
"host": conn_utils.writer_cluster_host,
9393
"port": conn_utils.port,
@@ -98,7 +98,7 @@ async def setup_tortoise_multi_db(self, conn_utils):
9898
}
9999
},
100100
"second_db": {
101-
"engine": "aws_advanced_python_wrapper.tortoise.backend.mysql",
101+
"engine": "aws_advanced_python_wrapper.tortoise.backends.mysql",
102102
"credentials": {
103103
"host": conn_utils.writer_cluster_host,
104104
"port": conn_utils.port,
@@ -149,7 +149,7 @@ async def setup_tortoise_with_router(self, conn_utils):
149149
config = {
150150
"connections": {
151151
"default": {
152-
"engine": "aws_advanced_python_wrapper.tortoise.backend.mysql",
152+
"engine": "aws_advanced_python_wrapper.tortoise.backends.mysql",
153153
"credentials": {
154154
"host": conn_utils.writer_cluster_host,
155155
"port": conn_utils.port,

0 commit comments

Comments
 (0)