Skip to content

Commit 58f7e15

Browse files
Fix unused parameter naming in _memory_cache_ttu
- Renamed 'now' parameter to '_now' to follow convention for unused parameters - Added ARG003 to noqa comment to suppress linting warning - Regenerated sync library to match async changes - Minor formatting fix in base.py (removed blank line) Co-authored-by: William Easton <strawgate@users.noreply.github.com>
1 parent e4e5f72 commit 58f7e15

File tree

3 files changed

+4
-5
lines changed
  • key-value
    • key-value-aio/src/key_value/aio/stores/memory
    • key-value-sync/src/key_value/sync/code_gen/stores

3 files changed

+4
-5
lines changed

key-value/key-value-aio/src/key_value/aio/stores/memory/store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ def to_managed_entry(self) -> ManagedEntry:
5757
return ManagedEntry.from_json(json_str=self.json_str)
5858

5959

60-
def _memory_cache_ttu(_key: Any, value: MemoryCacheEntry, now: float) -> float: # noqa: ARG001
60+
def _memory_cache_ttu(_key: Any, value: MemoryCacheEntry, _now: float) -> float:
6161
"""Calculate time-to-use for cache entries based on their expiration time.
6262
6363
This function is used by TLRUCache to determine when entries should expire.
6464
6565
Args:
6666
_key: The cache key (unused).
6767
value: The cache entry.
68-
now: The current time as an epoch timestamp (unused).
68+
_now: The current time as an epoch timestamp (unused).
6969
7070
Returns:
7171
The expiration time as an epoch timestamp, or sys.maxsize if the entry has no TTL.

key-value/key-value-sync/src/key_value/sync/code_gen/stores/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ def _put_managed_entries(
252252
created_at: datetime,
253253
expires_at: datetime | None,
254254
) -> None:
255-
256255
"""Store multiple managed entries by key in the specified collection.
257256
258257
Args:

key-value/key-value-sync/src/key_value/sync/code_gen/stores/memory/store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ def to_managed_entry(self) -> ManagedEntry:
5757
return ManagedEntry.from_json(json_str=self.json_str)
5858

5959

60-
def _memory_cache_ttu(_key: Any, value: MemoryCacheEntry, now: float) -> float:
60+
def _memory_cache_ttu(_key: Any, value: MemoryCacheEntry, _now: float) -> float:
6161
"""Calculate time-to-use for cache entries based on their expiration time.
6262
6363
This function is used by TLRUCache to determine when entries should expire.
6464
6565
Args:
6666
_key: The cache key (unused).
6767
value: The cache entry.
68-
now: The current time as an epoch timestamp (unused).
68+
_now: The current time as an epoch timestamp (unused).
6969
7070
Returns:
7171
The expiration time as an epoch timestamp, or sys.maxsize if the entry has no TTL.

0 commit comments

Comments
 (0)