Skip to content

Mae/business name#90

Open
mae-smarty wants to merge 3 commits into
masterfrom
mae/business-name
Open

Mae/business name#90
mae-smarty wants to merge 3 commits into
masterfrom
mae/business-name

Conversation

@mae-smarty

Copy link
Copy Markdown
Contributor

Added the business_name input parameter and associated testing and examples.

@mae-smarty mae-smarty marked this pull request as ready for review June 9, 2026 17:30

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the Makefile to include this file


class Lookup(LookupBase):
def __init__(self, smartykey=None, dataset=None, dataSubset=None, features=None, freeform=None, street=None, city=None, state=None, zipcode=None):
def __init__(self, smartykey=None, dataset=None, dataSubset=None, features=None, freeform=None, business_name=None, street=None, city=None, state=None, zipcode=None):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure how customers are using the Python SDK, but we should probably move string businessName = null to the end of the constructor, in the case that someone was doing this previously:

Lookup(null, null, null, null, "123 main st", "123 main st");

In this case, 123 main st was originally the street parameter, but now it is the businessName parameter. It's an edge case, but I would do this instead:

def __init__(self, smartykey=None, dataset=None, dataSubset=None, features=None, freeform=None, street=None, city=None, state=None, zipcode=None, business_name=None):

self.dataSubset = dataSubset
self.features = features
self.freeform = freeform
self.business_name = business_name

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to change this because I don't think there's a right answer in this repo, but in this file, two word variables are either camel case case (dataSubset) or lowercase (smartykey). In other lookup files, they do follow snake case. So anyways I just had to point that out.

and _is_blank(getattr(lookup, 'business_name', None))
):
raise SmartyException("Lookup requires one of 'smartykey', 'street', or 'freeform' to be set")
raise SmartyException("Lookup requires one of 'smartykey', 'street', 'freeform', or 'business_name' to be set")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you make a change according to my Lookup comment, I would change this too to either be smarty_key or businessName

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

Successfully merging this pull request may close these issues.

2 participants