I am trying to pass a Pandas Dataframe column in the where clause of a SQL. This column is of type string.
bill_id, product_name
101, prod_a
102, prod_b
103, prod_c
104, prod_d
prod_list = ','.join(["'" + str(x) + "'" for x in df['product_name'].tolist()])
I am trying to pass product name in the where clause of a SQL as below:
query = """select prod_id, product_name from products where product_name in (%s)""" % prod_list
This however seems to return back an empty Dataframe when I know there are matches available for values in that list