Support for PyMySQL
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia da prepare_connect_info e traccia il percorso con cui la sua proprietà port raggiunge la validazione di PyMySQL connections.py. Verifica il flusso di connessione esistente con una porta intera e conferma che il supporto funzioni senza compromettere gli altri connettori; il lavoro è completato quando una connessione PyMySQL accetta la porta configurata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 99
- Fork
- 22
- Merge medio
- 55m
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-advanced-python-wrapper
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 72/100
aws/aws-advanced-python-wrapper#1276 · 1 commento ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
aws/aws-advanced-python-wrapper#1275 · 1 commento ·
Tutte le issue di aws/aws-advanced-python-wrapper
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
use-agent-os/agent-os#3314 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BasedHardware/omi#15662 · 1 commento ·
-
documentation help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
AiursoftWeb/AnduinOS-2#19 ·