Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support for PyMySQL

オープン
#752 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
mysql, python
領域
databases

調査の方向性

prepare_connect_info から開始し、その port プロパティが PyMySQL connections.py の検証に到達するまでを追跡します。整数のポートを使った既存の接続フローを確認し、他のコネクタを壊さずにサポートが機能することを確認します。完了の条件は、PyMySQL 接続が設定されたポートを受け入れることです。

索引モデルが issue の本文から書いたものです。

説明

enhancement
Describe the feature

Support the usage of the pymysql connector

Use Case

The project I'm working on uses pymysql, I tried to pass the Connect class to the AwsWrapperConnection, however, it's failing because it's casting the port argument to a string, even though I'm passing an int.

Code that's turning the port into a string:

def prepare_connect_info(self, host_info: HostInfo, props: Properties) -> Properties:
        prop_copy: Properties = Properties(props.copy())

        prop_copy["host"] = host_info.host

        if host_info.is_port_specified():
            prop_copy["port"] = str(host_info.port)

        PropertiesUtils.remove_wrapper_props(prop_copy)
        return prop_copy

pymysql code enforcing the int type:
connections.py

// ...
self.port = port or 3306
        if type(self.port) is not int:
            raise ValueError("port should be of type int")
// ...

I wonder if it's possible to remove that cast to string or adapt somehow to support pymysql. I'm not sure if that's all it's going to take, though.

Proposed Solution

Remove the cast to string for the port

if host_info.is_port_specified():
            prop_copy["port"] = host_info.port

or a condition for the pymysql library

Other Information

No response

Acknowledgements
  • I may be able to implement this feature request
  • This feature might incur a breaking change
The AWS Advanced Python Wrapper version used

1.1.1

Python version used

3.12

Operating System and version

Ubuntu 22.04

主要言語
Python
スター
99
フォーク
22
平均マージ
6分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-advanced-python-wrapper のほかの issue

aws/aws-advanced-python-wrapper の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。