Skip to content

Commit 1602403

Browse files
committed
Refactor: modify the codebase to pass through the pre-commit hooks
1 parent 6dc9b44 commit 1602403

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

rest_framework/filters.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
returned by list views.
44
"""
55
import operator
6-
import warnings
76
from functools import reduce
87

98
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
@@ -14,8 +13,6 @@
1413
from django.utils.text import smart_split, unescape_string_literal
1514
from django.utils.translation import gettext_lazy as _
1615

17-
from rest_framework import RemovedInDRF317Warning
18-
from rest_framework.compat import coreapi, coreschema
1916
from rest_framework.fields import CharField
2017
from rest_framework.settings import api_settings
2118

@@ -256,9 +253,9 @@ def get_default_valid_fields(self, queryset, view, context={}):
256253
(field.source.replace('.', '__') or field_name, field.label)
257254
for field_name, field in serializer_class(context=context).fields.items()
258255
if (
259-
not getattr(field, 'write_only', False) and
260-
not field.source == '*' and
261-
field.source not in model_property_names
256+
not getattr(field, 'write_only', False) and
257+
not field.source == '*' and
258+
field.source not in model_property_names
262259
)
263260
]
264261

rest_framework/pagination.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import contextlib
7-
import warnings
87
from base64 import b64decode, b64encode
98
from collections import namedtuple
109
from urllib import parse
@@ -15,8 +14,6 @@
1514
from django.utils.encoding import force_str
1615
from django.utils.translation import gettext_lazy as _
1716

18-
from rest_framework import RemovedInDRF317Warning
19-
from rest_framework.compat import coreapi, coreschema
2017
from rest_framework.exceptions import NotFound
2118
from rest_framework.response import Response
2219
from rest_framework.settings import api_settings

rest_framework/schemas/coreapi.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
import warnings
21
from collections import Counter
3-
from urllib import parse
42

53
from django.db import models
64
from django.utils.encoding import force_str
75

8-
from rest_framework import RemovedInDRF317Warning, exceptions, serializers
9-
from rest_framework.compat import coreapi, coreschema, uritemplate
10-
from rest_framework.settings import api_settings
11-
12-
from .generators import BaseSchemaGenerator
13-
from .inspectors import ViewInspector
14-
from .utils import get_pk_description, is_list_view
6+
from rest_framework import serializers
7+
from rest_framework.compat import coreschema
158

169

1710
def common_path(paths):
@@ -186,6 +179,3 @@ def field_to_schema(field):
186179
)
187180

188181
return coreschema.String(title=title, description=description)
189-
190-
191-
å

0 commit comments

Comments
 (0)