Skip to content

Commit

Permalink
Add ruff rule UP006(use PEP585 annotations)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Sep 17, 2024
1 parent 6ba3c71 commit 48f3c85
Show file tree
Hide file tree
Showing 69 changed files with 1,217 additions and 1,281 deletions.
6 changes: 3 additions & 3 deletions libs/core/langchain_core/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from __future__ import annotations

import json
from typing import Any, List, Literal, Sequence, Union
from typing import Any, Literal, Sequence, Union

from langchain_core.load.serializable import Serializable
from langchain_core.messages import (
Expand Down Expand Up @@ -71,7 +71,7 @@ def is_lc_serializable(cls) -> bool:
return True

@classmethod
def get_lc_namespace(cls) -> List[str]:
def get_lc_namespace(cls) -> list[str]:
"""Get the namespace of the langchain object.
Default is ["langchain", "schema", "agent"]."""
return ["langchain", "schema", "agent"]
Expand Down Expand Up @@ -145,7 +145,7 @@ def is_lc_serializable(cls) -> bool:
return True

@classmethod
def get_lc_namespace(cls) -> List[str]:
def get_lc_namespace(cls) -> list[str]:
"""Get the namespace of the langchain object."""
return ["langchain", "schema", "agent"]

Expand Down
4 changes: 2 additions & 2 deletions libs/core/langchain_core/caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from __future__ import annotations

from abc import ABC, abstractmethod
from typing import Any, Dict, Optional, Sequence, Tuple
from typing import Any, Optional, Sequence

from langchain_core.outputs import Generation
from langchain_core.runnables import run_in_executor
Expand Down Expand Up @@ -157,7 +157,7 @@ def __init__(self, *, maxsize: Optional[int] = None) -> None:
Raises:
ValueError: If maxsize is less than or equal to 0.
"""
self._cache: Dict[Tuple[str, str], RETURN_VAL_TYPE] = {}
self._cache: dict[tuple[str, str], RETURN_VAL_TYPE] = {}
if maxsize is not None and maxsize <= 0:
raise ValueError("maxsize must be greater than 0")
self._maxsize = maxsize
Expand Down
Loading

0 comments on commit 48f3c85

Please sign in to comment.