Browse Source

Rename FileData to BinaryData

pull/1823/head
Hironsan 3 years ago
parent
commit
03e38f32ca
2 changed files with 3 additions and 3 deletions
  1. 4
      backend/data_import/pipeline/data.py
  2. 2
      backend/data_import/pipeline/factories.py

4
backend/data_import/pipeline/data.py

@ -37,7 +37,7 @@ class TextData(BaseData):
if value:
return value
else:
raise ValueError("is not empty.")
raise ValueError("The empty text is not allowed.")
def create(self, project: Project, meta: Dict[Any, Any]) -> Example:
return Example(
@ -50,6 +50,6 @@ class TextData(BaseData):
)
class FileData(BaseData):
class BinaryData(BaseData):
def create(self, project: Project, meta: Dict[Any, Any]) -> Example:
return Example(uuid=self.uuid, project=project, filename=self.filename, upload_name=self.upload_name, meta=meta)

2
backend/data_import/pipeline/factories.py

@ -23,7 +23,7 @@ def get_data_class(project_type: str):
if project_type in text_projects:
return data.TextData
else:
return data.FileData
return data.BinaryData
def create_parser(file_format: str, **kwargs):

Loading…
Cancel
Save