Fixed as_series() method and simplified compare() logic

master
Griffiths Lott 3 years ago
parent 78a6599d82
commit bd79683d46
  1. 18
      EINService.py

@ -56,13 +56,14 @@ class EINData:
"""
try:
compareDict = {
# Tenary operator used ot concisley assign values
# If they match then true, else false
"buinessName" : True if self.buinessName == otherEIN.buinessName else False,
"address" : True if self.address1 == otherEIN.address1 else False,
"city": True if self.city == otherEIN.city else False,
"state": True if self.state == otherEIN.state else False,
"zip" : True if self.zip == otherEIN.zip else False
# Checks wether these two data points match
# Thanks to the standardiztion provided by EINData's init
# there should be few matching issues
"buinessName" : self.buinessName == otherEIN.buinessName,
"address" : self.address1 == otherEIN.address1,
"city": self.city == otherEIN.city,
"state": self.state == otherEIN.state,
"zip" :self.zip == otherEIN.zip
}
except Exception as e:
error(f"""Exception:\n{e}\nSelf:{self}\nOther: {otherEIN}\n""")
@ -85,7 +86,7 @@ class EINData:
"""
Converts object into a pandas Series
"""
return Series(self.to_dict())
return Series(self.as_dict())
@ -243,6 +244,7 @@ class EINTaxIDService(__EINService):
addressPieces = address.split(',')
address1 = addressPieces[0].strip()
city = addressPieces[1].strip()
# State and Zip are only seperated by a space not a ','
state = addressPieces[2].strip().split(" ")[0].strip()
zip = addressPieces[2].strip().split(" ")[1].strip()
else:

Loading…
Cancel
Save