Add notebook pattern validation and standardize setup cells#163
Merged
petermuehlbacher merged 1 commit intomainfrom Feb 19, 2026
Merged
Add notebook pattern validation and standardize setup cells#163petermuehlbacher merged 1 commit intomainfrom
petermuehlbacher merged 1 commit intomainfrom
Conversation
c670f4e to
b24c0af
Compare
Add a CI validation script that checks all case study notebooks for: - Conditional everyrow pip install (try/except ImportError) - Conditional EVERYROW_API_KEY setup (if not in os.environ) - All everyrow op calls wrapped in create_session() with observability URL Insert standardized setup cells into all 18 notebooks and wrap bare everyrow op calls (merge, screen, dedupe) in create_session contexts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b24c0af to
6b5c8b1
Compare
Comment on lines
20
to
26
| "\n", | ||
| "This notebook demonstrates how to use the everyrow SDK's `dedupe` operation to deduplicate messy CRM data using AI-powered semantic matching." | ||
| "import os\n", | ||
| "if \"EVERYROW_API_KEY\" not in os.environ:\n", | ||
| " os.environ[\"EVERYROW_API_KEY\"] = \"your-api-key-here\" # Get one at everyrow.io\n" | ||
| ] | ||
| }, | ||
| { |
There was a problem hiding this comment.
Bug: The call to await client.__aexit__() is incorrect as it's missing the three required arguments for an async context manager, which will cause a TypeError on exit.
Severity: HIGH
Suggested Fix
The __aexit__ method should be called with the standard three None arguments to signify a clean exit from the context manager. Change await client.__aexit__() to await client.__aexit__(None, None, None) in src/everyrow/session.py.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: docs/case_studies/dedupe-crm-company-records/notebook.ipynb#L20-L26
Potential issue: The `__aexit__` method in `src/everyrow/session.py` is called without
any arguments. The async context manager protocol requires `__aexit__` to be called with
three arguments: `exc_type`, `exc_val`, and `exc_tb`. The `AuthenticatedClient` forwards
this call to the underlying `httpx.AsyncClient`, whose `__aexit__` method will raise a
`TypeError` because it's missing the required positional arguments. This will cause an
unhandled exception whenever a session is created and closed using the `create_session`
context manager, such as when `single_agent()` is called without an explicit session.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs-site/scripts/validate-notebook-patterns.pyvalidates all 18 case study notebooks enforce three patterns:%pip install everyrow(viatry/except ImportError)EVERYROW_API_KEYsetup (viaif not in os.environ)merge,screen,dedupe,rank,agent_map) wrapped inasync with create_session(name="...") as session:withsession.get_url()for observabilitycreate_sessioncontextsdeploy-docs.yamlworkflowTest plan
uv run python docs-site/scripts/validate-notebook-patterns.py— all 18 notebooks pass🤖 Generated with Claude Code