This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 6ebd555a10 GH-40439: [Python] Fix flake8 failures in
python/benchmarks/parquet.py (#40440)
6ebd555a10 is described below
commit 6ebd555a1095e64c04ccf4f6a0762d85b0bd0376
Author: Sutou Kouhei <[email protected]>
AuthorDate: Mon Mar 11 10:50:46 2024 +0900
GH-40439: [Python] Fix flake8 failures in python/benchmarks/parquet.py
(#40440)
### Rationale for this change
Failures:
/arrow/python/benchmarks/parquet.py:18:1: F401 'shutil' imported but
unused
/arrow/python/benchmarks/parquet.py:19:1: F401 'tempfile' imported but
unused
/arrow/python/benchmarks/parquet.py:23:1: F401 'pandas as pd' imported
but unused
### What changes are included in this PR?
* Remove unused imports.
* Add python/benchmarks/ to lint targets.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: #40439
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
dev/archery/archery/utils/lint.py | 9 +++++----
python/benchmarks/parquet.py | 4 ----
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dev/archery/archery/utils/lint.py
b/dev/archery/archery/utils/lint.py
index 3efe599405..15f22ca2e6 100644
--- a/dev/archery/archery/utils/lint.py
+++ b/dev/archery/archery/utils/lint.py
@@ -187,11 +187,12 @@ def python_linter(src, fix=False):
return
# Gather files for autopep8
- patterns = ["python/pyarrow/**/*.py",
+ patterns = ["python/benchmarks/**/*.py",
+ "python/examples/**/*.py",
+ "python/pyarrow/**/*.py",
"python/pyarrow/**/*.pyx",
"python/pyarrow/**/*.pxd",
"python/pyarrow/**/*.pxi",
- "python/examples/**/*.py",
"dev/*.py",
"dev/archery/**/*.py",
"dev/release/**/*.py"]
@@ -232,8 +233,8 @@ def python_linter(src, fix=False):
yield LintResult.from_cmd(
flake8("--extend-exclude=" + ','.join(flake8_exclude),
"--config=" + os.path.join(src.python, "setup.cfg"),
- setup_py, src.pyarrow, os.path.join(src.python, "examples"),
- src.dev, check=False))
+ setup_py, src.pyarrow, os.path.join(src.python, "benchmarks"),
+ os.path.join(src.python, "examples"), src.dev, check=False))
logger.info("Running Cython linter (cython-lint)")
diff --git a/python/benchmarks/parquet.py b/python/benchmarks/parquet.py
index e459ea2c36..ca39919b4b 100644
--- a/python/benchmarks/parquet.py
+++ b/python/benchmarks/parquet.py
@@ -15,12 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-import shutil
-import tempfile
-
from pandas.util.testing import rands
import numpy as np
-import pandas as pd
import pyarrow as pa
try: