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

Add ruff rules for print #570

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/knowledge-graph/ragstack_knowledge_graph/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def print_graph_documents(
for relation in doc.relationships:
source = relation.source
target = relation.target
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}")
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}") # noqa: T201


def render_graph_documents(
Expand Down
1 change: 1 addition & 0 deletions libs/ragulate/colbert_chunk_size_and_k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: T201
import logging
import os
import time
Expand Down
1 change: 1 addition & 0 deletions libs/ragulate/open_ai_chunk_size_and_k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: T201
import os

from langchain_astradb import AstraDBVectorStore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def query(self):
err = f"Query: '{query}' caused exception, skipping."
logger.exception(err)
# TODO: figure out why the logger isn't working after tru-lens starts. For now use print(). # noqa: E501
print(f"{err} Exception {e}")
print(f"{err} Exception {e}") # noqa: T201
finally:
self.update_progress(query_change=1)

Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ select = [
"SIM",
"SLOT",
"T10",
"T20",
"TCH",
"TRY",
"UP",
Expand All @@ -105,10 +106,16 @@ select = [
]

[tool.ruff.lint.per-file-ignores]
"**/libs/langchain/*" = [
"libs/langchain/*" = [
"UP006", # Incompatible with Pydantic v1
"UP007", # Incompatible with Pydantic v1
]
"**/{examples,notebooks,tests,e2e-tests}/*" = [
"T20",
]
"scripts/*" = [
"T20",
]

[build-system]
requires = ["poetry-core"]
Expand Down
Loading