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 ruff rules for comprehensions (C4) #26829

Merged
merged 1 commit into from
Sep 25, 2024

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 24, 2024 11:08pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: core Related to langchain-core 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Sep 24, 2024
@@ -108,7 +108,7 @@ def get_format_instructions(self) -> str:
return "Return a JSON object."
else:
# Copy schema to avoid altering original Pydantic schema.
schema = {k: v for k, v in self._get_schema(self.pydantic_object).items()}
schema = dict(self._get_schema(self.pydantic_object).items())
Copy link
Collaborator

@eyurtsev eyurtsev Sep 24, 2024

Choose a reason for hiding this comment

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

hmm why is this not .copy()

(no need to change in this PR -- since the PR should involve no functional changes)

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Sep 24, 2024
@eyurtsev eyurtsev self-assigned this Sep 24, 2024
@eyurtsev
Copy link
Collaborator

eyurtsev commented Sep 24, 2024

cc @efriis if you want to take another look prior to merging. I think this looks good, code is cleaner and likely at some point will result in a tiny code speed up due to short-circuiting where it wasn't before or due to elimination of redundant operations

@cbornet cbornet changed the title Add ruff rules for comprehensions (C4) core: Add ruff rules for comprehensions (C4) Sep 24, 2024
@eyurtsev eyurtsev merged commit 3a1b925 into langchain-ai:master Sep 25, 2024
98 checks passed
@cbornet cbornet deleted the ruff-rules-c4 branch September 25, 2024 15:32
Sheepsta300 pushed a commit to Sheepsta300/langchain that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: core Related to langchain-core lgtm PR looks good. Use to confirm that a PR is ready for merging. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants