diff --git a/Dockerfile b/Dockerfile index 43f73113..6804e7a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG PYTHON_VERSION="3.9.6-slim-buster" +ARG PYTHON_VERSION="3.8.12-slim-buster" ARG NODE_VERSION="16.5-alpine3.14" FROM node:${NODE_VERSION} AS frontend-builder diff --git a/backend/Dockerfile.dev b/backend/Dockerfile.dev index e7c47e7e..6e08d3bf 100644 --- a/backend/Dockerfile.dev +++ b/backend/Dockerfile.dev @@ -1,4 +1,4 @@ -ARG PYTHON_VERSION="3.9.6-slim-buster" +ARG PYTHON_VERSION="3.8.12-slim-buster" FROM python:${PYTHON_VERSION} RUN apt-get update \ diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod index 35c239ed..0d27c417 100644 --- a/backend/Dockerfile.prod +++ b/backend/Dockerfile.prod @@ -1,4 +1,4 @@ -ARG PYTHON_VERSION="3.9.6-slim-buster" +ARG PYTHON_VERSION="3.8.12-slim-buster" FROM python:${PYTHON_VERSION} CMD ["python3"] diff --git a/backend/api/models.py b/backend/api/models.py index c367ebf1..824d2953 100644 --- a/backend/api/models.py +++ b/backend/api/models.py @@ -1,8 +1,6 @@ import string from typing import Literal -from django import db - from auto_labeling_pipeline.models import RequestModelFactory from django.contrib.auth.models import User from django.core.exceptions import ValidationError diff --git a/backend/api/tasks.py b/backend/api/tasks.py index 980c0b5b..a44f3c5a 100644 --- a/backend/api/tasks.py +++ b/backend/api/tasks.py @@ -1,6 +1,6 @@ import itertools -from celery import shared_task +from celery import shared_task from celery.utils.log import get_task_logger from django.conf import settings from django.contrib.auth import get_user_model @@ -15,6 +15,8 @@ from .views.upload.factory import (get_data_class, get_dataset_class, from .views.upload.utils import append_field logger = get_task_logger(__name__) + + class Buffer: def __init__(self, buffer_size=settings.IMPORT_BATCH_SIZE): diff --git a/backend/api/views/label.py b/backend/api/views/label.py index dea5ac00..504b2bd0 100644 --- a/backend/api/views/label.py +++ b/backend/api/views/label.py @@ -15,12 +15,14 @@ from ..models import Label, Project from ..permissions import IsInProjectReadOnlyOrAdmin, IsProjectAdmin from ..serializers import LabelSerializer + def camel_to_snake(name): - name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) - return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() + name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) + return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() + def camel_to_snake_dict(d): - return {camel_to_snake(k): v for k,v in d.items()} + return {camel_to_snake(k): v for k, v in d.items()} class LabelList(generics.ListCreateAPIView):