Repository navigation
Enhanced conversions upload: use cells that already are SHA-256 digests - #124
Open
illia-sapryga wants to merge 1 commit into
Open
illia-sapryga wants to merge 1 commit into
illia-sapryga wants to merge 1 commit into
Conversation
A CRM export can hash identifiers before it writes the file. The parser hashed such a cell a second time, or read it as a malformed email or phone, so the row uploaded identifiers that match nobody. A cell holding a full SHA-256 hex digest is now used as it is, lowercased. The digest of an empty string counts as a blank cell. The preview counts the rows that carry digests and says normalization cannot be checked from a digest.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A CRM export can hash identifiers before it writes the file, so raw values never reach disk.
draft_upload_enhanced_conversions_for_leadsassumes raw values. A digest in the Email column has no@, so it's dropped as "not an address". In the name columns it gets hashed a second time. Either way the row can't match, and only the email and phone cases say anything.A cell holding a full 64-character SHA-256 hex digest is now used as it is, lowercased. This is per cell, so a file can mix raw and hashed columns, and raw cells are normalized and hashed as before.
I checked the preview counts against a file with digests.
rows_with_email,rows_with_phoneandrows_with_addresscome out the same as for the equivalent raw file, and digests aren't reported as a broken phone or email. Two things needed adding:rows_with_prehashed_identifiersand amatch_warningsline saying so, with the first affected rows.What it does not do: it doesn't add an option or a new tool, and it doesn't verify digests in any way beyond their shape. Files without digests produce the same preview as before. The sample rows still show
sha256:setand not the hash.Tested with the full suite plus
TestPrehashedEcIdentifiers, including a run throughconfirm_and_apply(dry_run=True)with the real validate-only wrapper and a fake upload service, which asserts the digests arrive unchanged inhashed_emailandhashed_phone_number. I have not run this code against a live account, and match rates for prehashed uploads are untested.