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

ref: Add ruff rules for bugbear (B) #3983

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Oct 1, 2024

No description provided.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Oct 1, 2024
@@ -63,6 +63,6 @@ def create_state_model_from_graph(graph: BaseModel) -> type[BaseModel]:
]
fields = {
camel_to_snake(vertex.id): state_model_getter
for vertex, state_model_getter in zip(graph.vertices, state_model_getters)
for vertex, state_model_getter in zip(graph.vertices, state_model_getters, strict=False)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reading the code, it seems graph.vertices and state_model_getters could have distinct size. Is it intended ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. We probably need to add the same checks on the second iteration or just build the fields dict in one go.

Copy link
Contributor

Choose a reason for hiding this comment

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

This part is still highly experimental and requires a lot more testing/inclusion into features

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3983.dmtpw4p5recq1.amplifyapp.com

@cbornet cbornet force-pushed the ruff-rules-b-2 branch 2 times, most recently from 7529086 to c152424 Compare October 1, 2024 18:03
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 1, 2024
@cbornet cbornet changed the title feat: Fix some B ruff rules ref: Fix some B ruff rules Oct 2, 2024
@cbornet cbornet force-pushed the ruff-rules-b-2 branch 2 times, most recently from f5b1b2a to 6d6a658 Compare October 2, 2024 13:11
@cbornet cbornet changed the title ref: Fix some B ruff rules ref: Add ruff rules for bugbear (B) Oct 2, 2024
@cbornet
Copy link
Collaborator Author

cbornet commented Oct 2, 2024

@ogabrielluiz thanks for the review.
I modified the PR to fix all B rules.
In retrospect, I should have done it in another commit instead of amending the first one... Sorry about that.
Can you take a look again ?
The main changes are that I replaced warnings.warn by loguru.logger.warning which is more appropriate (see https://docs.python.org/3/howto/logging.html#when-to-use-logging)

@cbornet cbornet force-pushed the ruff-rules-b-2 branch 5 times, most recently from e7020ed to 36ebdfd Compare October 2, 2024 15:28
Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

LGTM

@cbornet cbornet merged commit 7e3d470 into langflow-ai:main Oct 2, 2024
28 checks passed
@cbornet cbornet deleted the ruff-rules-b-2 branch October 2, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants