1

Basically, I using RETS to pull some listing from TREB using an MLS number. but I am getting below error while trying to iterate through the generator.

Error:

dmql_query = search_helper.filter_to_dmql(filter_dict=search_filter) File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\rets\utils\search.py", line 32, in filter_to_dmql raise TypeError( TypeError: Expected a dictionary type buy got <class 'str'> instead.

Code:

rets_client = Session(login_url, username, password, user_agent="python/rets", version="RETS/1.7")
rets_client.login()
system_data = rets_client.get_system_metadata()
search_res = rets_client.search('Property', 'ResidentialProperty', '(Ml_num="C5437829")')
print(search_res, type(search_res))
resultDict = dict(search_res)
print(search_res, type(resultDict))
for result in resultDict:
    print(result)

Can anyone tell me what the problem is?

pefile
  • 69
  • 6
  • can you try explicitly set the parameter names like `rets_client.search(resource='Property', resource_class='RES', limit=1, dmql_query='(ListPrice=150000+)')` – Lei Yang Mar 18 '22 at 04:58
  • getting this `rets.exceptions.RETSException: RETS Error 20200: Unknown Query Field`, on line resultDict = dict(search_res), I tried to iterate throught search_res as `for result in search_res` I still get an error – pefile Mar 18 '22 at 15:14
  • @LeiYang if Iterate though search_res without typecasting, I get `rets.exceptions.RETSException: RETS Error 20200: Unknown Query Field` – pefile Mar 18 '22 at 15:27
  • it means your origional question has been solved. – Lei Yang Mar 19 '22 at 02:43

0 Answers0