merge query.py