fix: Replaced deprecated typing.Text with str (#30230)

typing.Text is deprecated. Use str instead
This commit is contained in:
Sai-Suraj-27 2024-04-15 16:48:37 +05:30 committed by GitHub
parent f010786218
commit b3595cf02b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@ import re
# The following script is adapted from the script of TaPas.
# Original: https://github.com/google-research/tapas/master/wikisql_utils.py
from typing import Any, List, Text
from typing import Any, List
EMPTY_ANSWER = "none"
@ -114,7 +114,7 @@ class _Operator(enum.Enum):
class _Condition:
"""Represents an SQL where clauses (e.g A = "a" or B > 5)."""
column: Text
column: str
operator: _Operator
cmp_value: Any

View File

@ -24,7 +24,7 @@ import os
import re
import unicodedata
from dataclasses import dataclass
from typing import Callable, Dict, Generator, List, Optional, Text, Tuple, Union
from typing import Callable, Dict, Generator, List, Optional, Tuple, Union
import numpy as np
@ -70,19 +70,19 @@ class TokenCoordinates:
@dataclass
class TokenizedTable:
rows: List[List[List[Text]]]
rows: List[List[List[str]]]
selected_tokens: List[TokenCoordinates]
@dataclass(frozen=True)
class SerializedExample:
tokens: List[Text]
tokens: List[str]
column_ids: List[int]
row_ids: List[int]
segment_ids: List[int]
def _is_inner_wordpiece(token: Text):
def _is_inner_wordpiece(token: str):
return token.startswith("##")
@ -2224,14 +2224,14 @@ class NumericValueSpan:
@dataclass
class Cell:
text: Text
text: str
numeric_value: Optional[NumericValue] = None
@dataclass
class Question:
original_text: Text # The original raw question string.
text: Text # The question string after normalization.
original_text: str # The original raw question string.
text: str # The question string after normalization.
numeric_spans: Optional[List[NumericValueSpan]] = None