Update replace_temp_with_query.py