mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
partners[lint]: run pyupgrade to get code in line with 3.9 standards (#30781)
Using `pyupgrade` to get all `partners` code up to 3.9 standards (mostly, fixing old `typing` imports).
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
"""Test HuggingFace embeddings."""
|
||||
|
||||
from typing import Type
|
||||
|
||||
from langchain_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
|
||||
from langchain_huggingface.embeddings import (
|
||||
@@ -12,7 +10,7 @@ from langchain_huggingface.embeddings import (
|
||||
|
||||
class TestHuggingFaceEmbeddings(EmbeddingsIntegrationTests):
|
||||
@property
|
||||
def embeddings_class(self) -> Type[HuggingFaceEmbeddings]:
|
||||
def embeddings_class(self) -> type[HuggingFaceEmbeddings]:
|
||||
return HuggingFaceEmbeddings
|
||||
|
||||
@property
|
||||
@@ -22,7 +20,7 @@ class TestHuggingFaceEmbeddings(EmbeddingsIntegrationTests):
|
||||
|
||||
class TestHuggingFaceEndpointEmbeddings(EmbeddingsIntegrationTests):
|
||||
@property
|
||||
def embeddings_class(self) -> Type[HuggingFaceEndpointEmbeddings]:
|
||||
def embeddings_class(self) -> type[HuggingFaceEndpointEmbeddings]:
|
||||
return HuggingFaceEndpointEmbeddings
|
||||
|
||||
@property
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Generator
|
||||
from collections.abc import Generator
|
||||
|
||||
from langchain_huggingface.llms import HuggingFacePipeline
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Standard LangChain interface tests"""
|
||||
|
||||
from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.tools import BaseTool
|
||||
@@ -12,7 +10,7 @@ from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
|
||||
|
||||
class TestHuggingFaceEndpoint(ChatModelIntegrationTests):
|
||||
@property
|
||||
def chat_model_class(self) -> Type[BaseChatModel]:
|
||||
def chat_model_class(self) -> type[BaseChatModel]:
|
||||
return ChatHuggingFace
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user