Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Addresses Randomly Throw TypeError #12

Open
fouisgras opened this issue Feb 24, 2017 · 0 comments
Open

Some Addresses Randomly Throw TypeError #12

fouisgras opened this issue Feb 24, 2017 · 0 comments

Comments

@fouisgras
Copy link

fouisgras commented Feb 24, 2017

Python 2.7, latest pyzillow release.

import numpy as np
import pandas as pd
from pyzillow.pyzillow import ZillowWrapper, GetUpdatedPropertyDetails
from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults
 
address = '255 Ewell Ct '
zipcode = '60103'
 
zillow_data = ZillowWrapper('X1-ZWz1a2vwc1ckqz_2rqd6')
deep_search_response = zillow_data.get_deep_search_results(address, zipcode)
result = GetDeepSearchResults(deep_search_response)
result

This address in particular, as well as others, will throw the following error:

TypeError                                 Traceback (most recent call last)
/home/hello/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_code(self, code_obj, result)
   2896             if result is not None:
   2897                 result.error_in_exec = sys.exc_info()[1]
-> 2898             self.showtraceback()
   2899         else:
   2900             outflag = 0

/home/hello/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in showtraceback(self, exc_tuple, filename, tb_offset, exception_only)
   1824                                             value, tb, tb_offset=tb_offset)
   1825 
-> 1826                     self._showtraceback(etype, value, stb)
   1827                     if self.call_pdb:
   1828                         # drop into debugger

/home/hello/.local/lib/python2.7/site-packages/ipykernel/zmqshell.pyc in _showtraceback(self, etype, evalue, stb)
    509             u'traceback' : stb,
    510             u'ename' : unicode_type(etype.__name__),
--> 511             u'evalue' : py3compat.safe_unicode(evalue),
    512         }
    513 

/home/hello/.local/lib/python2.7/site-packages/ipython_genutils/py3compat.pyc in safe_unicode(e)
     63     """
     64     try:
---> 65         return unicode_type(e)
     66     except UnicodeError:
     67         pass

TypeError: coercing to Unicode: need string or buffer, dict found

I have no clue why some addresses in particular are causing this error, but most of them work fine. I am iterating through a list of many addresses using pyzillow, and if get_deep_search_results doesn't like an address, my code breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant