Support for PyMySQL
还没有人认领这个 Issue。
评估
调研方向
从 prepare_connect_info 开始,跟踪其 port 属性如何传递到 PyMySQL connections.py 的验证逻辑。使用整数端口检查现有的连接流程,并确认支持能够正常工作且不会破坏其他连接器;当 PyMySQL 连接接受配置的端口时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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
- 平均合并
- 55 分钟
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-advanced-python-wrapper 的其他 Issue
-
bug
难度 4/5 3-5 天 新手友好度 72/100
aws/aws-advanced-python-wrapper#1276 · 1 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 48/100
aws/aws-advanced-python-wrapper#1275 · 1 条评论 ·
查看 aws/aws-advanced-python-wrapper 的全部 Issue
相似的 Issue
-
triage/confirmed
难度 2/5 1-3 小时 新手友好度 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
难度 1/5 1 小时以内 新手友好度 92/100
NousResearch/hermes-agent#118866 ·
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
apache/cloudstack#14222 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100