Skip to content

Commit

Permalink
Updating comments and vars for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Pijush Chakraborty committed Jan 7, 2025
1 parent a08b91b commit 0788d22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions firebase_admin/remote_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,20 +587,20 @@ def _compare_semantic_versions(self, target_value, actual_value, predicate_fn) -
return self._compare_versions(str(actual_value),
str(target_value), predicate_fn)

def _compare_versions(self, version1, version2, predicate_fn) -> bool:
def _compare_versions(self, sem_version_1, sem_version_2, predicate_fn) -> bool:
"""Compares two semantic version strings.
Args:
version1: The first semantic version string.
version2: The second semantic version string.
sem_version_1: The first semantic version string.
sem_version_2: The second semantic version string.
predicate_fn: A function that takes an integer and returns a boolean.
Returns:
bool: The result of the predicate function.
"""
try:
v1_parts = [int(part) for part in version1.split('.')]
v2_parts = [int(part) for part in version2.split('.')]
v1_parts = [int(part) for part in sem_version_1.split('.')]
v2_parts = [int(part) for part in sem_version_2.split('.')]
max_length = max(len(v1_parts), len(v2_parts))
v1_parts.extend([0] * (max_length - len(v1_parts)))
v2_parts.extend([0] * (max_length - len(v2_parts)))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_remote_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def test_evaluate_custom_signal_semantic_version(self,


class MockAdapter(testutils.MockAdapter):
"""A Mock HTTP Adapter that Firebase Remote Config with ETag in header."""
"""A Mock HTTP Adapter that provides Firebase Remote Config responses with ETag in header."""

ETAG = 'etag'

Expand Down

0 comments on commit 0788d22

Please sign in to comment.