Skip to content

Commit

Permalink
Add flake8-tidy-imports extension (#4229)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Aug 8, 2022
1 parent 3d51dca commit 1dce28b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions py-polars/.flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
max-line-length = 88
ban-relative-imports = true
docstring-convention=all
extend-ignore =
# Satisfy black: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
Expand Down
1 change: 1 addition & 0 deletions py-polars/build.requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ flake8-bugbear==22.7.1
flake8-comprehensions==3.10.0
flake8-docstrings==1.6.0
flake8-simplify==0.19.3
flake8-tidy-imports==4.8.0
ghp-import==2.1.0
sphinx==4.3.2
pydata-sphinx-theme==0.9.0
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def version() -> str:
# this is only useful for documentation
warnings.warn("polars binary missing!")

import polars.testing as testing
from polars import testing
from polars.cfg import Config
from polars.convert import (
from_arrow,
Expand Down
30 changes: 20 additions & 10 deletions py-polars/polars/internals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
they all import from each other via this __init__ file using
`import polars.internals as pli`. The imports below are being shared across this module.
"""
from .anonymous_scan import (
from polars.internals.anonymous_scan import (
_deser_and_exec,
_scan_ds,
_scan_ipc_fsspec,
_scan_parquet_fsspec,
)
from .datatypes import IntoExpr
from .expr import Expr, expr_to_lit_or_expr, selection_to_pyexpr_list, wrap_expr
from .frame import DataFrame, wrap_df
from .functions import concat, date_range
from .io import _is_local_file, _prepare_file_arg, read_ipc_schema, read_parquet_schema
from .lazy_frame import LazyFrame, wrap_ldf
from .lazy_functions import (
from polars.internals.datatypes import IntoExpr
from polars.internals.expr import (
Expr,
expr_to_lit_or_expr,
selection_to_pyexpr_list,
wrap_expr,
)
from polars.internals.frame import DataFrame, wrap_df
from polars.internals.functions import concat, date_range
from polars.internals.io import (
_is_local_file,
_prepare_file_arg,
read_ipc_schema,
read_parquet_schema,
)
from polars.internals.lazy_frame import LazyFrame, wrap_ldf
from polars.internals.lazy_functions import (
all,
arg_where,
argsort_by,
Expand All @@ -26,8 +36,8 @@
lit,
select,
)
from .series import Series, wrap_s
from .whenthen import when # used in expr.clip()
from polars.internals.series import Series, wrap_s
from polars.internals.whenthen import when # used in expr.clip()

__all__ = [
"DataFrame",
Expand Down
3 changes: 1 addition & 2 deletions py-polars/polars/internals/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
sequence_to_pydf,
series_to_pydf,
)
from polars.internals.lazy_frame import LazyFrame
from polars.internals.slice import PolarsSlice
from polars.utils import (
_prepare_row_count_args,
Expand All @@ -60,8 +61,6 @@
range_to_slice,
)

from .lazy_frame import LazyFrame # noqa: F401

try:
from polars.polars import PyDataFrame, PySeries

Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import inspect

import polars as pl
import polars.datatypes as datatypes
from polars import datatypes


def test_dtype_init_equivalence() -> None:
Expand Down

0 comments on commit 1dce28b

Please sign in to comment.