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

Fixing tests for rdt 1.13.2 #2320

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Fixing tests for rdt 1.13.2 #2320

merged 4 commits into from
Dec 17, 2024

Conversation

amontanez24
Copy link
Contributor

No description provided.

@amontanez24 amontanez24 requested a review from a team as a code owner December 14, 2024 04:28
@amontanez24 amontanez24 requested review from frances-h and removed request for a team December 14, 2024 04:28
@amontanez24 amontanez24 requested a review from fealho December 14, 2024 04:31
Copy link

codecov bot commented Dec 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (84cf401) to head (a022983).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2320      +/-   ##
==========================================
- Coverage   98.58%   98.57%   -0.02%     
==========================================
  Files          58       58              
  Lines        6085     6085              
==========================================
- Hits         5999     5998       -1     
- Misses         86       87       +1     
Flag Coverage Δ
integration 82.11% <100.00%> (-0.17%) ⬇️
unit 97.41% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@fealho fealho left a comment

Choose a reason for hiding this comment

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

The failing test can be fixed by sorting the order of the rows for both dataframes.

@fealho fealho requested review from gsheni and removed request for frances-h December 16, 2024 21:26
@@ -299,7 +299,7 @@ def _fit(self, table_data):
self._uuids_to_combinations = {}
for combination in self._combinations.itertuples(index=False, name=None):
mappable_combination = get_mappable_combination(combination)
uuid_str = str(uuid.uuid4())
uuid_str = str(uuid.uuid5(uuid.NAMESPACE_DNS, str(mappable_combination)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works but do we have to worry about the fact that mappable_combination is not actually a valid DNS? In the docs for uuid, it says

When this namespace is specified, the name string is a fully qualified domain name.

Copy link
Member

@fealho fealho Dec 17, 2024

Choose a reason for hiding this comment

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

The namespace is any uuid and name is any string, which are then concatenated and hashed. This is a good discussion on the topic.

If you prefer we can also hash it ourselves, like so:

hex_string = hashlib.md5(str(mappable_combination).encode("UTF-8")).hexdigest()
uuid_str = uuid.UUID(hex=hex_string)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The link to the discussion is broken, but honestly either one is fine. We just need to make sure that each combination is mapped to a unique value.

The more I think about it, we only promise that sampling can be reset to get the same values. Since this happens during fitting, it might be ok to just leave as is and sort in the test.

Copy link
Member

Choose a reason for hiding this comment

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

True, from a user perspective both solutions work. I'd still lean towards getting rid of the randomness, but either way is fine.

@amontanez24 amontanez24 merged commit bbe861e into main Dec 17, 2024
41 checks passed
@amontanez24 amontanez24 deleted the test-rdt-1.13.2 branch December 17, 2024 15:40
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