Skip to content

Commit

Permalink
Update autoflake parameters to remove unused imports (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie256 committed Oct 7, 2021
1 parent 3032b0e commit 09e0289
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -111,7 +111,7 @@ lint: ## Check code for lint errors.

lint-fix: ## Automatically fix linting issues.
@$(call i, Running the linter)
poetry run autoflake --in-place --remove-unused-variables $(src.python) $(tst.python) $(tst.notebooks.python)
poetry run autoflake --in-place --remove-all-unused-imports --remove-unused-variables $(src.python) $(tst.python) $(tst.notebooks.python)

format: ## Check style formatting.
@$(call i, Checking import formatting)
Expand Down
6 changes: 3 additions & 3 deletions src/whylogs/proto/__init__.py
Expand Up @@ -3,6 +3,6 @@
Protobuf allows us to serialize/deserialize classes across languages
"""
from .constraints_pb2 import *
from .messages_pb2 import *
from .summaries_pb2 import *
from .constraints_pb2 import * # noqa
from .messages_pb2 import * # noqa
from .summaries_pb2 import * # noqa
5 changes: 1 addition & 4 deletions tests/component/test_performance_log_dataframe.py
Expand Up @@ -10,11 +10,8 @@
import pandas as pd
import pytest

from whylogs import DatasetProfile
from whylogs.app.config import SessionConfig, WriterConfig
from whylogs.app.session import get_or_create_session, session_from_config
from whylogs.app.writers import writer_from_config
from whylogs.util import time
from whylogs.app.session import session_from_config

script_dir = os.path.dirname(os.path.realpath(__file__))
TEST_LOGGER = getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Expand Up @@ -4,7 +4,6 @@
import pandas as pd
import pytest

import whylogs
from whylogs.core.datasetprofile import DatasetProfile

_MY_DIR = os.path.realpath(os.path.dirname(__file__))
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/app/test_segments.py
Expand Up @@ -8,7 +8,7 @@
from pandas import util

from whylogs.app.config import SessionConfig, WriterConfig
from whylogs.app.logger import _TAG_KEY, _TAG_PREFIX, _TAG_VALUE
from whylogs.app.logger import _TAG_PREFIX, _TAG_VALUE
from whylogs.app.session import session_from_config


Expand Down
2 changes: 0 additions & 2 deletions tests/unit/app/test_session.py
Expand Up @@ -3,8 +3,6 @@

from whylogs.app.config import SessionConfig
from whylogs.app.session import (
Session,
get_logger,
get_or_create_session,
get_session,
reset_default_session,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/app/test_writers.py
Expand Up @@ -4,7 +4,6 @@
import pytest
from moto import mock_s3
from moto.s3.responses import DEFAULT_REGION_NAME
from smart_open import open

from whylogs.app import WriterConfig
from whylogs.app.config import load_config
Expand Down
1 change: 0 additions & 1 deletion tests/unit/core/metrics/test_nlp_metrics.py
@@ -1,7 +1,6 @@
import pytest

from whylogs.core.metrics.nlp_metrics import NLPMetrics
from whylogs.proto import NLPMetricsMessage


def test_nlp_metrics():
Expand Down
1 change: 0 additions & 1 deletion tests/unit/core/statistics/test_numbertracker.py
@@ -1,5 +1,4 @@
import pytest
from testutil import compare_frequent_items

from whylogs.core.statistics import NumberTracker

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/core/test_annotation_profiling.py
Expand Up @@ -4,7 +4,7 @@
from uuid import uuid4

from whylogs.core.annotation_profiling import BB_ATTRIBUTES, TrackBB
from whylogs.core.datasetprofile import DatasetProfile, array_profile, dataframe_profile
from whylogs.core.datasetprofile import DatasetProfile

TEST_DATA_PATH = os.path.abspath(
os.path.join(
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/core/test_columnprofile.py
Expand Up @@ -7,8 +7,6 @@
from whylogs.proto import ColumnMessage, ColumnSummary, InferredType
from whylogs.util.protobuf import message_to_dict

from ...helpers.testutil import compare_frequent_items


def test_all_numeric_types_get_tracked_by_number_tracker():
all_values = [
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/core/test_image_profiling.py
Expand Up @@ -4,9 +4,8 @@

from PIL import Image

from whylogs.core.datasetprofile import DatasetProfile, array_profile, dataframe_profile
from whylogs.core.datasetprofile import DatasetProfile
from whylogs.core.image_profiling import _METADATA_DEFAULT_ATTRIBUTES, TrackImage
from whylogs.features import _IMAGE_FEATURES

TEST_DATA_PATH = os.path.abspath(
os.path.join(
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/io/test_local_dataset.py
@@ -1,7 +1,5 @@
import os

from PIL.Image import Image as ImageType

from whylogs.io.local_dataset import LocalDataset


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/util/test_protobuf.py
@@ -1,7 +1,7 @@
import json
import os

from whylogs.proto import DatasetProperties, DoublesMessage, NumbersMessage
from whylogs.proto import DoublesMessage
from whylogs.util import protobuf

_MY_DIR = os.path.realpath(os.path.dirname(__file__))
Expand Down

0 comments on commit 09e0289

Please sign in to comment.