Browse Source

Add type hint to marker

pull/1823/head
Hironsan 2 years ago
parent
commit
553e7b3c28
2 changed files with 3 additions and 3 deletions
  1. 4
      backend/data_import/pipeline/makers.py
  2. 2
      backend/data_import/tests/test_makers.py

4
backend/data_import/pipeline/makers.py

@ -27,7 +27,7 @@ class ExampleMaker:
self.data_class = data_class
self.column_data = column_data
self.exclude_columns = exclude_columns or []
self._errors = []
self._errors: List[FileParseException] = []
def make(self, df: pd.DataFrame) -> List[Example]:
if not self.check_column_existence(df):
@ -76,7 +76,7 @@ class LabelMaker:
def __init__(self, column: str, label_class: Type[Label]):
self.column = column
self.label_class = label_class
self._errors = []
self._errors: List[FileParseException] = []
def make(self, df: pd.DataFrame) -> List[Label]:
if not self.check_column_existence(df):

2
backend/data_import/tests/test_makers.py

@ -4,8 +4,8 @@ import pandas as pd
from django.test import TestCase
from data_import.pipeline.data import TextData
from data_import.pipeline.formatters import ExampleMaker, LabelMaker
from data_import.pipeline.label import CategoryLabel
from data_import.pipeline.makers import ExampleMaker, LabelMaker
from data_import.pipeline.readers import (
FILE_NAME_COLUMN,
LINE_NUMBER_COLUMN,

Loading…
Cancel
Save