Support for PyMySQL
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at prepare_connect_info and trace how its port property reaches the PyMySQL connections.py validation. Check the existing connection flow with an integer port and confirm that support works without breaking other connectors; done means a PyMySQL connection accepts the configured port.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 99
- Forks
- 22
- Avg merge
- 55m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-advanced-python-wrapper
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 72/100
aws/aws-advanced-python-wrapper#1276 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
aws/aws-advanced-python-wrapper#1275 · 1 comment ·
All issues in aws/aws-advanced-python-wrapper
Similar issues
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 Half a day Newbie friendliness 62/100
inmanta/inmanta-core#10835 ·
-
sponsored
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Diaoul/subliminal#1382 ·