amhkhowaja / patients-portal-for-students

0 stars 65 forks source link

Resulting returning an Row objected instead of string id #1

Open idafoh opened 6 months ago

idafoh commented 6 months ago

https://github.com/amhkhowaja/patients-portal-for-students/blob/5d0176241bfdc6f5c38dc910f85f311aa94c2d8b/src/patient_db.py#L46

I had to change change this to: return result.inserted_primary_key[0]

@amhkhowaja

amhkhowaja commented 6 months ago

Thanks for raising issue . For now you can change it in your api controller code or whereever you are calling it , it will basically return a tuple . You can index it there for now I will review it again

idafoh commented 6 months ago

Sure but I saw the doc string says that it returns a string, it took me a while to realize there was a issue because of misleading doc, that's why I created this issue https://github.com/amhkhowaja/patients-portal-for-students/blob/5d0176241bfdc6f5c38dc910f85f311aa94c2d8b/src/patient_db.py#L39

amhkhowaja commented 6 months ago

Yeah thats true , my bad i will correct it and yes it should return a string conventionally