Skip to content

Commit 88cf239

Browse files
committed
Bump ruff version to 0.12
1 parent 9b7c35c commit 88cf239

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

langchain/langchain_vectorize/retrievers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def format_docs(docs):
111111
"""The Vectorize API token."""
112112
environment: Literal["prod", "dev", "local", "staging"] = "prod"
113113
"""The Vectorize API environment."""
114-
organization: Optional[str] = None # noqa: UP007
114+
organization: Optional[str] = None
115115
"""The Vectorize organization ID."""
116-
pipeline_id: Optional[str] = None # noqa: UP007
116+
pipeline_id: Optional[str] = None
117117
"""The Vectorize pipeline ID."""
118118
num_results: int = 5
119119
"""The number of documents to return."""

langchain/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Issues = "https://github.com/vectorize-io/integrations-python/issues"
3333
dev = [
3434
"mypy>=1.13.0",
3535
"pytest>=8.3.3",
36-
"ruff>=0.9.0,<0.10",
36+
"ruff>=0.12.7,<0.13",
3737
]
3838

3939
[tool.ruff.lint]
@@ -49,6 +49,7 @@ ignore = [
4949
pydocstyle.convention = "google"
5050
flake8-annotations.allow-star-arg-any = true
5151
flake8-annotations.mypy-init-return = true
52+
pyupgrade.keep-runtime-typing = true
5253

5354
[tool.ruff.lint.per-file-ignores]
5455
"tests/*" = [

langchain/tests/test_retrievers.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
from langchain_vectorize.retrievers import VectorizeRetriever
1515

16+
logger = logging.getLogger(__name__)
17+
1618

1719
@pytest.fixture(scope="session")
1820
def api_token() -> str:
@@ -35,7 +37,7 @@ def org_id() -> str:
3537
@pytest.fixture(scope="session")
3638
def environment() -> Literal["prod", "dev", "local", "staging"]:
3739
env = os.getenv("VECTORIZE_ENV", "prod")
38-
if env not in ["prod", "dev", "local", "staging"]:
40+
if env not in {"prod", "dev", "local", "staging"}:
3941
msg = "Invalid VECTORIZE_ENV environment variable."
4042
raise ValueError(msg)
4143
return env
@@ -76,7 +78,7 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
7678
),
7779
)
7880
source_connector_id = response.connector.id
79-
logging.info("Created source connector %s", source_connector_id)
81+
logger.info("Created source connector %s", source_connector_id)
8082

8183
uploads_api = v.UploadsApi(api_client)
8284
upload_response = uploads_api.start_file_upload_to_connector(
@@ -107,23 +109,23 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
107109
msg = "Upload failed:"
108110
raise ValueError(msg)
109111
else:
110-
logging.info("Upload successful")
112+
logger.info("Upload successful")
111113

112114
ai_platforms = v.AIPlatformConnectorsApi(api_client).get_ai_platform_connectors(
113115
org_id
114116
)
115117
builtin_ai_platform = next(
116118
c.id for c in ai_platforms.ai_platform_connectors if c.type == "VECTORIZE"
117119
)
118-
logging.info("Using AI platform %s", builtin_ai_platform)
120+
logger.info("Using AI platform %s", builtin_ai_platform)
119121

120122
vector_databases = v.DestinationConnectorsApi(
121123
api_client
122124
).get_destination_connectors(org_id)
123125
builtin_vector_db = next(
124126
c.id for c in vector_databases.destination_connectors if c.type == "VECTORIZE"
125127
)
126-
logging.info("Using destination connector %s", builtin_vector_db)
128+
logger.info("Using destination connector %s", builtin_vector_db)
127129

128130
pipeline_response = pipelines.create_pipeline(
129131
org_id,
@@ -150,14 +152,14 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
150152
),
151153
)
152154
pipeline_id = pipeline_response.data.id
153-
logging.info("Created pipeline %s", pipeline_id)
155+
logger.info("Created pipeline %s", pipeline_id)
154156

155157
yield pipeline_id
156158

157159
try:
158160
pipelines.delete_pipeline(org_id, pipeline_id)
159161
except Exception:
160-
logging.exception("Failed to delete pipeline %s", pipeline_id)
162+
logger.exception("Failed to delete pipeline %s", pipeline_id)
161163

162164

163165
def test_retrieve_init_args(

langchain/uv.lock

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)