-
Notifications
You must be signed in to change notification settings - Fork 1
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
[HACKDAYS] ES_PREDICATES and ES_STREET_PREDICATES pipelines #88
base: main
Are you sure you want to change the base?
Conversation
@@ -117,17 +117,45 @@ def execute_pipeline | |||
local_concerns[config.field] = [] if local_concerns[config.field].nil? | |||
next if local_concerns[config.field].present? | |||
|
|||
next if config.field == :address && concerns_preclude_validation(local_concerns.values.flatten) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not execute any full address predicate if we already have local concerns.
|
||
sig { returns(T.nilable(AtlasEngine::AddressValidation::Validators::FullAddress::AddressComparison)) } | ||
def address_comparison | ||
@address_comparison ||= AddressValidation::Es::CandidateSelector.new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the simple non multi-locale call for now. Supporting multi-locale would be a small refactor to move the logic from the best_candidate
method in FullAddress
to another class and call that here.
@address_comparison ||= AddressValidation::Es::CandidateSelector.new( | ||
datastore: AtlasEngine::AddressValidation::Es::Datastore.new(address: @address), | ||
address: @address, | ||
).best_candidate&.address_comparison # TODO: get rid of the tuple, it's not needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need the CandidateTuple
anymore since the address comparison is now initialized with the candidate.
- field: address | ||
class: AtlasEngine::AddressValidation::Validators::Predicates::FullAddress::Found | ||
- field: zip | ||
class: AtlasEngine::AddressValidation::Validators::Predicates::Zip::ValidForProvince |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the zip checks at the end of the pipeline to still return zip concerns if a candidate is not found.
aaa31a2
to
48131ce
Compare
94881ae
to
6c67b3d
Compare
…reclude_validation logic
6c67b3d
to
9067ef1
Compare
Context
Hackdays POC for making full address validation logic run in the predicate pipeline
Approach
es_predicates
andes_street_predicates
pipelines for A/B testingfound
,zip_known
,city_known
,province_known
,street_known
es_predicates
andes_street_predicates
pipelinesTesting
With ES strategy:
With ES predicates strategy:
🐞 Bug fix 🐞
ES strategy has no concerns on invalid zip if a candidate is found:
ES_PREDICATES strategy will still run the zip valid checks as a final sanity check even if a candidate is found and determined to be "good"
🎩 Benchmarking results on
dev_tagged
suite for US 🎩vs current baseline performance of
Checklist