Skip to content

Conversation

@oschwald
Copy link
Member

  • Update deps
  • Update ruff ignores
  • Implement hash in models

oschwald added 3 commits June 18, 2025 07:55
Ruff wants this whenever __eq__ is implemented.
@faktas2 faktas2 requested a review from Copilot June 18, 2025 17:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates dependencies and linter configurations for Ruff 0.12.0 while also adding a hash implementation to model classes. Key changes include the removal of flake8 ignore comments in the request module and the introduction of an explicit hash method in the models module.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
minfraud/request.py Removal of flake8 ignore comments in domain and email cleaning functions.
minfraud/models.py Addition of a hash method and related formatting updates (including FBT001 noqa comments) in model constructors.
Comments suppressed due to low confidence (1)

minfraud/request.py:357

  • The removal of the flake8 ignore comment for E203 appears intentional with the updated linter configuration; please confirm that these changes no longer trigger linter warnings.
        tld = domain[idx + 1 :]

Comment on lines +23 to +24
# This is not particularly efficient, but I don't expect it to be used much.
return hash(json.dumps(self.to_dict(), sort_keys=True))
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

The new hash implementation using json.dumps with sort_keys is clear but may have performance implications if used frequently; consider caching the result if this method is expected to be called repeatedly.

Suggested change
# This is not particularly efficient, but I don't expect it to be used much.
return hash(json.dumps(self.to_dict(), sort_keys=True))
if not hasattr(self, "_cached_hash"):
self._cached_hash = hash(json.dumps(self.to_dict(), sort_keys=True))
return self._cached_hash

Copilot uses AI. Check for mistakes.
@horgh horgh merged commit 6eca6b0 into main Jun 18, 2025
46 checks passed
@horgh horgh deleted the greg/eng-2244 branch June 18, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants