Skip to content

Commit 3bc2416

Browse files
authored
chore: address linter issues (#207)
1 parent f2944cc commit 3bc2416

File tree

10 files changed

+35
-21
lines changed

10 files changed

+35
-21
lines changed

Diff for: .github/styles/Vocab/Aurora/accept.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[A-Za-z]+(?:_[A-Za-z]+)
2+
[Ff]ailover
3+
Postgres
4+
Powershell
5+
[Pp]sycopg
6+
[Gg]radle
7+
MySQL
8+
GitHub
9+
VSC[OoDdEe]
10+
P[YyCcHhAaRrMm]
11+
Powershell
12+
autocommit
13+
hostname
14+
[Kk]eepalive

Diff for: .github/styles/vocab.txt

-3
This file was deleted.

Diff for: .github/workflows/vale.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
- uses: errata-ai/vale-action@reviewdog
18+
with:
19+
fail_on_error: true

Diff for: .vale.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
StylesPath = .github/styles
22
MinAlertLevel = suggestion
3+
Vocab = Aurora
34

45
[*.md]
56
BasedOnStyles = Vale

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ [email protected] with any additional questions or comments.
5555

5656
## Security issue notifications
5757

58-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
58+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue.
5959

6060

6161
## Licensing

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ The `aws-advanced-python-wrapper` has a regular monthly release cadence. A new r
140140

141141
This `aws-advanced-python-wrapper` is being tested against the following Community and Aurora database versions in our test suite:
142142

143-
| Database | Versions |
144-
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
145-
| MySQL | 8.0.32 |
146-
| PostgreSQL | 15.2 |
147-
| Aurora MySQL | MySQL 8.0.mysql_aurora.3.02.2 (Wire-compatible with MySQL 8.0.23 onwards. For more details see [here](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraMySQLReleaseNotes/AuroraMySQL.Updates.3022.html)) |
148-
| Aurora PostgreSQL | 14.7 and 15.2 (Compatible with PostgreSQL 14.7 and 15.2, see release notes [here](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html)) |
143+
| Database | Versions |
144+
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
145+
| MySQL | 8.0.32 |
146+
| PostgreSQL | 15.2 |
147+
| Aurora MySQL | MySQL 8.0.mysql_aurora.3.02.2 (Wire-compatible with MySQL 8.0.23 onward. For more details see [here](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraMySQLReleaseNotes/AuroraMySQL.Updates.3022.html)) |
148+
| Aurora PostgreSQL | 14.7 and 15.2 (Compatible with PostgreSQL 14.7 and 15.2, see release notes [here](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html)) |
149149

150150
The `aws-advanced-python-wrapper` is compatible with MySQL 5.7 and MySQL 8.0 as per MySQL Connector/Python.
151151

Diff for: docs/development-guide/IntegrationTests.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This documentation walks through the requirements and steps required to run and
1212
- Mac/Linux:
1313
- `curl -sSL https://install.python-poetry.org | python3 -`
1414
- `poetry install`
15-
- Windows (powershell):
15+
- Windows (Powershell):
1616
- `(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -`
1717
- `poetry install`
1818

@@ -50,18 +50,18 @@ unset FILTER # Done testing the IAM tests, unset FILTER
5050
1. If you don’t have one already, create a `.bashrc` file at `~/` if you are on Mac or `C:\Users\<your_username>\`
5151
if you are on PC
5252
2. Add the environment variables specified in the [Environment Variables section](#environment-variables) to
53-
your `.bashrc` file to set their default values. The default valuescan be overridden on the command line
53+
your `.bashrc` file to set their default values. The default values can be overridden on the command line
5454
2. Install Poetry
5555
- Mac/Linux:
5656
- `curl -sSL https://install.python-poetry.org | python3 -`
57-
- Windows (powershell):
57+
- Windows (Powershell):
5858
- `(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -`
5959
3. Execute `poetry install` to install the aws_wrapper module and the required dependencies
6060
4. Open a git bash terminal in VSCode or Pycharm by opening the terminal window, clicking the dropdown, and then
6161
selecting “git bash”. The terminal window can be opened using “View → Tool Windows → Terminal” in Pycharm or “View →
6262
Terminal” in VSCode.
6363
5. Run `source ~/.bashrc` in the new terminal to load your environment variables.
64-
6. In the git bash terminal, navigate to the project root directory and execute a gradle integration test task, eg:
64+
6. In the git bash terminal, navigate to the project root directory and execute a gradle integration test task, e.g.:
6565
`./gradlew test-pg-aurora`. Other tasks are defined in `tests/integration/host/build.gradle.kts`.
6666

6767
## Debugging Aurora Integration Tests - Pycharm
@@ -90,7 +90,7 @@ unset FILTER # Done testing the IAM tests, unset FILTER
9090
3. At the top right of the Pycharm window, click the dropdown arrow and select your newly created debug configuration
9191
4. Click the bug symbol to start the debug configuration. Pycharm will begin listening for a debug connection
9292
5. Navigate to your Pycharm git bash terminal. In the terminal, navigate to the project root directory. Execute a gradle
93-
integration test debug task, eg: `./gradlew debug-pg-aurora`. Other tasks are defined
93+
integration test debug task, e.g.: `./gradlew debug-pg-aurora`. Other tasks are defined
9494
in `tests/integration/host/build.gradle.kts`
9595
6. The logs in the console will print the following message prompting you to open the Pycharm debug window when the
9696
debugger has attached:
@@ -105,8 +105,8 @@ unset FILTER # Done testing the IAM tests, unset FILTER
105105
2. If you haven’t already, create a `launch.json` file in the `.vscode` directory. Add an `Attach` configuration as
106106
the [one provided in this repository](../../.vscode/launch.json).
107107
3. Add any desired breakpoints to the integration test code.
108-
4. Navigate to your Pycharm git bash terminal. In the terminal, navigate to the project root directory. Execute a gradle
109-
integration test debug task, eg: `./gradlew debug-pg-aurora`. Other tasks are defined
108+
4. Navigate to your Pycharm git bash terminal. In the terminal, navigate to the project root directory. Execute a Gradle
109+
integration test debug task, e.g.: `./gradlew debug-pg-aurora`. Other tasks are defined
110110
in `tests/integration/host/build.gradle.kts`.
111111
5. Wait for the following message prompting you to attach the debugger from VSCode:
112112
`Starting debugpy - you may now attach to the debugger from vscode...`

Diff for: docs/using-the-python-driver/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ User applications can have two types of connections:
99
1. active connections that are used to execute statements or perform other types of database operations.
1010
2. idle connections that the application holds references to but are not used for any operations.
1111

12-
For instance, a user application has an active connection and an idle connection to host A where host A is a writer instance. The user application executes DML statements against host A when a cluster failover occurrs. A different host is promoted as the writer, so host A is now a reader. The driver will failover the active connection to the new writer, but it will not modify the idle connection.
12+
For instance, a user application has an active connection and an idle connection to host A where host A is a writer instance. The user application executes DML statements against host A when a cluster failover occurs. A different host is promoted as the writer, so host A is now a reader. The driver will failover the active connection to the new writer, but it will not modify the idle connection.
1313

1414
When the application tries to continue the workflow with the idle connection that is still pointing to a host that has changed roles, i.e. host A, users may get an error caused by unexpected behaviour, such as `cannot execute UPDATE in a read-only transaction`.
1515

Diff for: docs/using-the-python-driver/using-plugins/UsingTheFailoverPlugin.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In addition to the parameters that you can configure for the underlying driver,
2626

2727
| Parameter | Value | Required | Description | Default Value |
2828
|----------------------------------------------|:-------:|:--------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
29-
| `failover_mode` | String | No | Defines a mode for failover process. Failover process may prioritize hosts with different roles and connect to them. Possible values: <br><br>- `strict_writer` - Failover process follows writer host and connects to a new writer when it changes.<br>- `reader_or_writer` - During failover, the driver tries to connect to any available/accessible reader host. If no reader is available, the driver will connect to a writer host. This logic mimics the logic of the Aurora read-only cluster endpoint.<br>- `strict_reader` - During failover, the driver tries to connect to any available reader host. If no reader is available, the driver raises an error. Reader failover to a writer host will only be allowed for single-host clusters. This logic mimics the logic of the Aurora read-only cluster endpoint.<br><br>If this parameter is omitted, default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader_or_writer`. Otherwise, it's `strict_writer`. | Default value depends on connection url. For Aurora read-only cluster endpoint, it's set to `reader_or_writer`. Otherwise, it's `strict_writer`. |
29+
| `failover_mode` | String | No | Defines a mode for failover process. Failover process may prioritize hosts with different roles and connect to them. Possible values: <br><br>- `strict_writer` - Failover process follows writer host and connects to a new writer when it changes.<br>- `reader_or_writer` - During failover, the driver tries to connect to any available/accessible reader host. If no reader is available, the driver will connect to a writer host. This logic mimics the logic of the Aurora read-only cluster endpoint.<br>- `strict_reader` - During failover, the driver tries to connect to any available reader host. If no reader is available, the driver raises an error. Reader failover to a writer host will only be allowed for single-host clusters. This logic mimics the logic of the Aurora read-only cluster endpoint.<br><br>If this parameter is omitted, default value depends on connection URL. For Aurora read-only cluster endpoint, it's set to `reader_or_writer`. Otherwise, it's `strict_writer`. | Default value depends on connection URL. For Aurora read-only cluster endpoint, it's set to `reader_or_writer`. Otherwise, it's `strict_writer`. |
3030
| `cluster_instance_host_pattern` | String | If connecting using an IP address or custom domain URL: Yes<br><br>Otherwise: No | This parameter is not required unless connecting to an AWS RDS cluster via an IP address or custom domain URL. In those cases, this parameter specifies the cluster instance DNS pattern that will be used to build a complete instance endpoint. A "?" character in this pattern should be used as a placeholder for the DB instance identifiers of the instances in the cluster. See [here](#host-pattern) for more information. <br/><br/>Example: `?.my-domain.com`, `any-subdomain.?.my-domain.com:9999`<br/><br/>Use case Example: If your cluster instance endpoints follow this pattern:`instanceIdentifier1.customHost`, `instanceIdentifier2.customHost`, etc. and you want your initial connection to be to `customHost:1234`, then your connection parameters should look like this: `host=customHost:1234 cluster_instance_host_pattern=?.customHost` | If the provided connection string is not an IP address or custom domain, the AWS Advanced Python Driver will automatically acquire the cluster instance host pattern from the customer-provided connection string. |
3131
| `enable_failover` | Boolean | No | Set to `True` to enable the fast failover behavior offered by the AWS Advanced Python Driver. Set to `False` for simple database connections that do not require fast failover functionality. | `True` |
3232
| `failover_cluster_topology_refresh_rate_sec` | Integer | No | Cluster topology refresh rate in seconds during a writer failover process. During the writer failover process, cluster topology may be refreshed at a faster pace than normal to speed up discovery of the newly promoted writer. | `2` |
@@ -71,7 +71,7 @@ When the AWS Advanced Python Driver throws a `TransactionResolutionUnknownError`
7171
#### Sample Code
7272

7373
[PostgreSQL Failover Sample Code](../../examples/PGFailover.py)
74-
[Mysql Failover Sample Code](../../examples/MySQLFailover.py)
74+
[MySQL Failover Sample Code](../../examples/MySQLFailover.py)
7575

7676
>### :warning: Warnings About Proper Usage of the AWS Advanced Python Driver
7777
>

Diff for: docs/using-the-python-driver/using-plugins/UsingTheIamAuthenticationPlugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To enable the IAM Authentication Connection Plugin, add the plugin code `iam` to
1010

1111
## AWS IAM Database Authentication
1212
The AWS Python Driver supports Amazon AWS Identity and Access Management (IAM) authentication. When using AWS IAM database authentication, the host URL must be a valid Amazon endpoint, and not a custom domain or an IP address.
13-
<br>ie. `db-identifier.cluster-XYZ.us-east-2.rds.amazonaws.com`
13+
<br>i.e. `db-identifier.cluster-XYZ.us-east-2.rds.amazonaws.com`
1414

1515
IAM database authentication use is limited to certain database engines. For more information on limitations and recommendations, please [review the IAM documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).
1616

0 commit comments

Comments
 (0)