Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Add various ruff rules #26836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Sep 24, 2024

No description provided.

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Sep 27, 2024 9:27pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: core Related to langchain-core labels Sep 24, 2024
@cbornet cbornet force-pushed the ruff-rules-multi branch 4 times, most recently from 30b57a4 to 540635a Compare September 26, 2024 09:56
@@ -291,9 +292,14 @@ async def _render_mermaid_using_pyppeteer(
img_bytes = await page.screenshot({"fullPage": False})
await browser.close()

def write_to_file(path: str, bytes: bytes) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this from a ruff rule?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes because we are in an async context so we can’t use blocking open() and write() directly (ruff rule ASYNC)

@eyurtsev
Copy link
Collaborator

@cbornet looks good -- what fraction of these have corresponding auto-formatting if any?

@cbornet
Copy link
Collaborator Author

cbornet commented Sep 26, 2024

Auto-fix is mostly raise SomeError() -> raise SomeError.
The rest (only 6 fixes) is manual.

@cbornet cbornet force-pushed the ruff-rules-multi branch 3 times, most recently from b65fd5a to 88f1e9f Compare September 27, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: core Related to langchain-core size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants