translate_tool_internal / services /test_data_processor.py
AtoX-Keisuke-Ogawa
fix data test part
e53672b
Raw
History Blame Contribute Delete
982 Bytes
from config.logger import logger
import pandas as pd
class Test:
def __init__(self):
return
def test_category_matching(self, category_df, dish_df):
pass_check = True
cat_uniques = category_df['カテゴリ名(日本語)'].dropna().unique()
dish_uniques = dish_df['カテゴリ名(日本語)'].dropna().unique()
for i in cat_uniques:
if i not in dish_uniques:
logger.warning(f'マスターカテゴリータブの中で料理タブに存在しないカテゴリーが入ってます: {i}')
# ここは存在しててもクリティカルな問題ないので、pass_checkはFalseにしない
for i in dish_uniques:
if i not in cat_uniques:
logger.warning(f'料理タブの中でマスターカテゴリータブに存在しないカテゴリーが入ってます: {i}')
pass_check = False
return pass_check