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

fix: Pin typing_extensions to fix Pydantic issue #4987

Merged
merged 1 commit into from
May 23, 2023
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
11 changes: 6 additions & 5 deletions haystack/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

from typing import Any, Optional, Dict, List, Union

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal # type: ignore

from pathlib import Path
from uuid import uuid4
import logging
Expand All @@ -18,6 +13,12 @@
import ast
from dataclasses import asdict

# The Literal type from typing_extension is safer to use as
# the one from typing has different bugs in the different versions.
# For more info see typing_extensions official docs:
# https://typing-extensions.readthedocs.io/en/latest/#Literal
from typing_extensions import Literal

import numpy as np
from numpy import ndarray
import pandas as pd
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ classifiers = [
dependencies = [
"requests",
"pydantic",
# FIXME: typing_extensions 4.6.0 broke Pydantic, so we pin it temporarily
# waiting for the release. For more info see this issue:
# https://github.com/pydantic/pydantic/issues/5821
"typing_extensions==4.5.0",
"transformers[torch]==4.29.1",
"protobuf<=3.20.2", # same version they use in transformers[sentencepiece]
"pandas",
Expand Down Expand Up @@ -184,7 +188,6 @@ dev = [
"pre-commit",
# Type check
"mypy",
"typing_extensions; python_version < '3.8'",
# Test
"pytest",
"pytest-cov",
Expand Down