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

feat: Add equality to Email #739

Merged
merged 3 commits into from Mar 6, 2020

Conversation

mcintyre94
Copy link
Contributor

Checklist

  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file (I don't think any is relevant, but happy to add anything appropriate if I've missed it)
  • I have added in line documentation to the code I modified

Short description of what this PR does:

Email objects are defined as equal iff they have the same email and the same name.
This is useful for unit tests where we want to verify that the Email objects generated are as expected.

Email objects are defined as equal iff they have the same email and the same name.
This is useful for unit tests where we want to verify that the Email objects generated are as expected.
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Nov 29, 2018
@SendGridDX
Copy link

SendGridDX commented Nov 29, 2018

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Nov 29, 2018

Codecov Report

Merging #739 into master will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #739      +/-   ##
==========================================
+ Coverage   82.41%   82.48%   +0.06%     
==========================================
  Files          70       70              
  Lines        2303     2312       +9     
  Branches      338      340       +2     
==========================================
+ Hits         1898     1907       +9     
  Misses        206      206              
  Partials      199      199              

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea90f7c...0e746ca. Read the comment docs.

@childish-sambino childish-sambino changed the title Add equality to Email feat: Add equality to Email Mar 6, 2020
@childish-sambino childish-sambino merged commit b2ca1f4 into sendgrid:master Mar 6, 2020
@mcintyre94 mcintyre94 deleted the email-equality branch March 7, 2020 19:39
@eprykhodko
Copy link

If, I may point out, this makes Email objects unhashable, which is inconvenient in some cases. For example getting rid of duplicates in a list of cc's. I suppose this should be considered a regression and should be fixed up?

@childish-sambino
Copy link
Contributor

@eprykhodko Ack, taking a look. This was definitely not the intent.

@childish-sambino
Copy link
Contributor

I'm just gonna roll this back. The original change was when the Email class only contained an email address and a name. Later (I don't understand why) other fields were introduced including a subject, substitutions, and a personalization.

childish-sambino pushed a commit that referenced this pull request Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
5 participants