Skip to content

Fix notebook fixture to ignore non-notebook files - #199

Open
zjn20030811 wants to merge 1 commit into
NirDiamant:mainfrom
zjn20030811:fix-notebook-path-filter
Open

Fix notebook fixture to ignore non-notebook files#199
zjn20030811 wants to merge 1 commit into
NirDiamant:mainfrom
zjn20030811:fix-notebook-path-filter

Conversation

@zjn20030811

@zjn20030811 zjn20030811 commented Sep 1, 2026

Copy link
Copy Markdown

Summary

  • restrict the notebook path fixture to .ipynb files
  • prevent all_rag_techniques/README.md from being parsed as a notebook

Testing

  • python -m py_compile tests/conftest.py tests/test_imports.py
  • parsed all 41 selected notebooks with nbformat.read(..., as_version=4) and confirmed README.md is excluded

The targeted notebook import test now proceeds past notebook parsing. It subsequently reports unrelated missing or incompatible optional dependencies in the local environment, including LlamaIndex and legacy LangChain import paths.

Summary by CodeRabbit

  • Tests
    • Updated notebook test coverage to include only valid .ipynb files, improving test accuracy.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 88676e82-bc4c-4037-8163-4b53376a5b42

📥 Commits

Reviewing files that changed from the base of the PR and between b143d42 and f96c279.

📒 Files selected for processing (1)
  • tests/conftest.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The notebook_paths test fixture now includes only .ipynb files from all_rag_techniques/.

Changes

Notebook Fixture Filtering

Layer / File(s) Summary
Filter notebook fixture entries
tests/conftest.py
The notebook_paths fixture excludes directory entries that do not end with .ipynb.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to f96c2

The change limits notebook fixture discovery to .ipynb files, preventing README.md from being parsed as a notebook. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: the notebook fixture now ignores non-notebook files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Filter notebook fixture paths by file extension

🐞 Bug fix 🧪 Tests 🕐 Less than 5 minutes

Grey Divider

AI Description

• Restricts notebook test discovery to .ipynb files.
• Prevents README and other non-notebook files from reaching notebook parsers.
Diagram

graph TD
  A["Notebook folder"] --> B["Extension filter"] --> C["Exclude filter"] --> D["Notebook tests"]
Loading
High-Level Assessment

Filtering during fixture discovery is the simplest and most appropriate approach because it enforces the fixture's notebook-only contract before parsing. A pathlib glob could express the same rule, but would add unnecessary churn for this localized fix.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
conftest.pyRestrict notebook fixture discovery to '.ipynb' files +1/-1

Restrict notebook fixture discovery to '.ipynb' files

• Filters directory entries by the notebook extension before applying explicit exclusions. This prevents README files and other non-notebook content from being passed to notebook parsing tests.

tests/conftest.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

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