Skip to content

Commit 1993bc2

Browse files
committed
Upgrade dependencies to support up to python 3.13
1 parent e83d0c1 commit 1993bc2

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

code-env/python/desc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"PYTHON36",
44
"PYTHON37",
55
"PYTHON38",
6-
"PYTHON39"
6+
"PYTHON39",
7+
"PYTHON310",
8+
"PYTHON311",
9+
"PYTHON312",
10+
"PYTHON313"
711
],
812
"forceConda": false,
913
"installCorePackages": true,

code-env/python/spec/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
emoji==0.6.0
2-
fastcore==1.3.1
2+
fastcore==1.3.1; python_version < '3.10'
3+
fastcore==1.12.6; python_version >= '3.10'
34
jieba==0.42.1
45
langid==1.1.6
56
pycld3==0.22; python_version < '3.10'
@@ -9,7 +10,8 @@ pymorphy2-dicts-uk==2.4.1.1.1460299261
910
pymorphy2==0.9.1
1011
pyvi==0.1
1112
regex==2021.4.4
12-
spacy[lookups,ja,th]==2.3.5
13+
spacy[lookups,ja,th]==2.3.5; python_version < '3.10'
14+
spacy[lookups,ja,th]==3.8.11; python_version >= '3.10'
1315
symspellpy==6.7.0
1416
tqdm==4.60.0
1517
sudachipy==0.6.0; python_version == '3.6'

python-lib/language_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def detect_languages_df(self, df: pd.DataFrame, text_column: AnyStr) -> pd.DataF
145145
self.column_descriptions = {}
146146
for k, v in self.COLUMN_DESCRIPTIONS.items():
147147
self.column_descriptions[generate_unique(k, df.keys(), text_column)] = v
148-
doc_iterator = (doc for _, doc in df[text_column].astype(str).iteritems())
148+
doc_iterator = (doc for _, doc in df[text_column].astype(str).items())
149149
output_df = df.copy()
150150
with ThreadPoolExecutor(max_workers=self.NUM_THREADS) as executor:
151151
lang_output_tuple_list = list(executor.map(self.detect_language_doc, doc_iterator))

tests/python/unit/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
pandas~=1.0
2-
numpy==1.26.4
1+
pandas~=1.0; python_version < '3.13'
2+
pandas~=2.0; python_version >= '3.13'
3+
numpy==1.26.4; python_version < '3.13'
4+
numpy==2.4.1; python_version >= '3.13'
35
pytest~=6.2
46
allure-pytest~=2.8

tests/python/unit/test_language_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
OUTPUT_DF["input_text"] = INPUT_DF["input_text"]
2626
OUTPUT_DF["input_text_language_code"] = ["", "es", "fr", "en", "ja"]
2727
OUTPUT_DF["input_text_language_name"] = ["", "Spanish", "French", "English", "Japanese"]
28-
OUTPUT_DF["input_text_language_score"] = [np.NaN, np.NaN, 1.0, 1.0, 1.0]
28+
OUTPUT_DF["input_text_language_score"] = [np.nan, np.nan, 1.0, 1.0, 1.0]
2929

3030
def test_language_detector():
3131
detector = LanguageDetector(minimum_score=0.2, fallback_language="es")

0 commit comments

Comments
 (0)