diff --git a/python/.flake8 b/python/.flake8 index 6df84325..d0ec008c 100644 --- a/python/.flake8 +++ b/python/.flake8 @@ -1,18 +1,26 @@ [flake8] max-line-length = 88 builtins = dbutils -extend-ignore = +extend-ignore = # Line too long (88 characters) (E501) E501, # Name may be undefined, or defined from star imports: module (F405) F405, # Invalid escape sequence 'x' (W605) W605, - # 'from module import *' used; unable to detect undefined names (F403) - F403 exclude = + .git __pycache__ env - .env + .tox + build + .venv venv - .venv \ No newline at end of file + .coverage.py + .coverage + .coveragerc + .eggs + .mypy_cache + .pytest_cache + dbl_tempo.egg-info + .tox \ No newline at end of file diff --git a/python/tests/interpol_tests.py b/python/tests/interpol_tests.py index ec7d0a29..b8b20f87 100644 --- a/python/tests/interpol_tests.py +++ b/python/tests/interpol_tests.py @@ -1,10 +1,9 @@ import unittest -from pyspark.sql.types import * +from pyspark.sql.dataframe import DataFrame from tempo.interpol import Interpolation from tempo.tsdf import TSDF -from tempo.utils import * from tests.tsdf_tests import SparkTest diff --git a/python/tests/intervals_tests.py b/python/tests/intervals_tests.py index 841b4dd2..9a10ba26 100644 --- a/python/tests/intervals_tests.py +++ b/python/tests/intervals_tests.py @@ -1,4 +1,6 @@ -from tempo.intervals import * +from pyspark.sql.dataframe import DataFrame + +from tempo.intervals import IntervalsDF from tests.tsdf_tests import SparkTest from pyspark.sql.utils import AnalysisException import pyspark.sql.functions as f diff --git a/python/tests/utils_tests.py b/python/tests/utils_tests.py index 24c16d69..c5cdb808 100644 --- a/python/tests/utils_tests.py +++ b/python/tests/utils_tests.py @@ -2,7 +2,8 @@ import sys import unittest -from tempo.utils import * +from tempo.utils import * # noqa: F403 + from tests.tsdf_tests import SparkTest from unittest import mock diff --git a/python/tox.ini b/python/tox.ini index 315b0f3d..6b8da542 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -7,7 +7,7 @@ isolated_build = true envlist = format lint - type + type-check build-dist ; Mirror Supported LTS DBR versions here: https://docs.databricks.com/release-notes/runtime/ ; Use correct PySpark version based on Python version present in env name @@ -85,24 +85,3 @@ commands = [coverage:run] source = tempo parallel = true - -[flake8] -exclude = - .git - __pycache__ - env - .tox - build - .venv - venv - .coverage.py - .coverage - .coveragerc - .eggs - .mypy_cache - .pytest_cache - dbl_tempo.egg-info -max-line-length = 88 -extend-ignore = - ; See https://github.com/PyCQA/pycodestyle/issues/373 - E203 \ No newline at end of file