Python Insert Variable Into Sql Query To Join