Skip to content

Simplify raise-on-missing adapter flow#319

Open
github-actions[bot] wants to merge 3 commits intomainfrom
simplify-raise-on-missing-d8e956cc01b7db20
Open

Simplify raise-on-missing adapter flow#319
github-actions[bot] wants to merge 3 commits intomainfrom
simplify-raise-on-missing-d8e956cc01b7db20

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

  • simplify RaiseOnMissingAdapter.get and ttl to remove redundant branches while preserving behavior
  • keep missing-key handling consistent with the existing raise_on_missing flag

Testing

  • UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache make test-concise

AI generated by Code Simplifier

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Feb 19, 2026

Streamline key_value.aio.adapters.raise_on_missing.adapter.RaiseOnMissingAdapter.get and .ttl to return fetched results directly and only raise MissingKeyError when results are None as part of the raise-on-missing flow

Refactors return paths in RaiseOnMissingAdapter to return awaited fetch results unconditionally unless the result is None with raise-on-missing enabled, affecting get and ttl in adapter.py.

📍Where to Start

Start with the RaiseOnMissingAdapter.get method in adapter.py, then review the ttl method to see the matching control-flow change.


Macroscope summarized 9b0128f.

@strawgate strawgate marked this pull request as ready for review February 19, 2026 16:52
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Feb 19, 2026

Simplify raise-on-missing flow by updating key_value.aio.adapters.raise_on_missing.adapter.RaiseOnMissingAdapter.get and .ttl to return underlying store results and raise MissingKeyError only when None with raise_on_missing=True

Update RaiseOnMissingAdapter methods to return underlying results directly and raise MissingKeyError only on None with raise_on_missing=True; adjust Elasticsearch tests to iterate over indices.body without .keys() in adapter.py and test_elasticsearch.py.

📍Where to Start

Start with RaiseOnMissingAdapter.get and RaiseOnMissingAdapter.ttl in adapter.py.


Macroscope summarized 7a98ce1.

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Looking for bugs?

Come back again in a few minutes. An AI review agent is analysing this pull request

Grey Divider

Qodo Logo

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

APPROVE

Generated by PR Review Agent for issue #319

@github-actions
Copy link
Copy Markdown
Contributor Author

Summary:

  • CI failed on ruff SIM118 in tests/stores/elasticsearch/test_elasticsearch.py (dict .keys() usage).
  • Updated the test helpers to iterate the dict directly, matching SIM118 guidance.
tests/stores/elasticsearch/test_elasticsearch.py:51-63
return [str(index_name) for index_name in indices.body]
...
existing = {str(index_name) for index_name in indices.body}

Tests:

  • UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache make test-concise
  • UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache make lint (fails locally: markdownlint not installed)

Generated by PR Checks Fixer

Repository owner deleted a comment from qodo-free-for-open-source-projects Bot Feb 19, 2026
Repository owner deleted a comment from qodo-free-for-open-source-projects Bot Feb 19, 2026
@strawgate
Copy link
Copy Markdown
Owner

/ai let's take care of the CI failure in this PR too

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Summary: fixed SIM118 by iterating Elasticsearch indices dicts directly in tests/stores/elasticsearch/test_elasticsearch.py.

Tests: UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache make test-concise

Lint: UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache make lint (fails locally: markdownlint not installed).

Generated by PR Assistant for issue #319

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.

1 participant