Can anyone help what is the problem with this code?
image_url = "gs://{}/{}".format(bucket_name, image_name)
cursor.execute("SELECT image_url FROM image_db WHERE image_url = %s",(image_url,))
I am getting this error>
TypeError: not all arguments converted during string formatting
I tried formatting the string in different ways but it did not solve the issue.
I tested your problem in my setup and didn't run into the error you mentioned. Maybe there's a difference in our setups or in the database. Here's the code I used for testing (with Python version 3.11.5 and PyMySQL version 1.1.08) :
And I didn't get any errors. It worked fine and gave me the correct results:
So, if you're still stuck, you might want to check if everything is set up correctly on your end, or if there's something different about how your database is expecting the data.