Browse Source

Fix typo: injest -> ingest

pull/1565/head
Hironsan 3 years ago
parent
commit
fed94b70f3
4 changed files with 6 additions and 6 deletions
  1. 2
      backend/api/tasks.py
  2. 4
      backend/api/tests/test_tasks.py
  3. 4
      backend/api/views/import_dataset.py
  4. 2
      frontend/pages/projects/_id/upload/index.vue

2
backend/api/tasks.py

@ -89,7 +89,7 @@ class DataFactory:
@shared_task @shared_task
def injest_data(user_id, project_id, filenames, format: str, **kwargs):
def ingest_data(user_id, project_id, filenames, format: str, **kwargs):
project = get_object_or_404(Project, pk=project_id) project = get_object_or_404(Project, pk=project_id)
user = get_object_or_404(get_user_model(), pk=user_id) user = get_object_or_404(get_user_model(), pk=user_id)
response = {'error': []} response = {'error': []}

4
backend/api/tests/test_tasks.py

@ -4,7 +4,7 @@ from django.test import TestCase
from ..models import (DOCUMENT_CLASSIFICATION, SEQ2SEQ, SEQUENCE_LABELING, from ..models import (DOCUMENT_CLASSIFICATION, SEQ2SEQ, SEQUENCE_LABELING,
Category, Example, Label, Span) Category, Example, Label, Span)
from ..tasks import injest_data
from ..tasks import ingest_data
from .api.utils import prepare_project from .api.utils import prepare_project
@ -20,7 +20,7 @@ class TestIngestData(TestCase):
def ingest_data(self, filename, file_format, kwargs=None): def ingest_data(self, filename, file_format, kwargs=None):
filenames = [str(self.data_path / filename)] filenames = [str(self.data_path / filename)]
kwargs = kwargs or {} kwargs = kwargs or {}
return injest_data(self.user.id, self.project.item.id, filenames, file_format, **kwargs)
return ingest_data(self.user.id, self.project.item.id, filenames, file_format, **kwargs)
class TestIngestClassificationData(TestIngestData): class TestIngestClassificationData(TestIngestData):

4
backend/api/views/import_dataset.py

@ -10,7 +10,7 @@ from rest_framework.views import APIView
from ..models import Project from ..models import Project
from ..permissions import IsProjectAdmin from ..permissions import IsProjectAdmin
from ..tasks import injest_data
from ..tasks import ingest_data
from .upload.catalog import Options from .upload.catalog import Options
@ -41,7 +41,7 @@ class UploadAPI(APIView):
for tu in tus for tu in tus
] ]
filenames = [su.file.path for su in sus] filenames = [su.file.path for su in sus]
task = injest_data.delay(
task = ingest_data.delay(
user_id=request.user.id, user_id=request.user.id,
project_id=project_id, project_id=project_id,
filenames=filenames, filenames=filenames,

2
frontend/pages/projects/_id/upload/index.vue

@ -87,7 +87,7 @@
:disabled="isDisabled" :disabled="isDisabled"
@click="injest" @click="injest"
> >
Injest
Ingest
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>

Loading…
Cancel
Save