Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI][Python] Archery linter is failing currently on main #36973

Closed
raulcd opened this issue Aug 1, 2023 · 1 comment · Fixed by #36976
Closed

[CI][Python] Archery linter is failing currently on main #36973

raulcd opened this issue Aug 1, 2023 · 1 comment · Fixed by #36976

Comments

@raulcd
Copy link
Member

raulcd commented Aug 1, 2023

Describe the bug, including details regarding any error messages, version, and platform.

It does seem that a new version of pyflakes8 released on the 29th is making our linter fail, see this job:
https://github.com/apache/arrow/actions/runs/5726747811/job/15517800197?pr=36616

We haven't noticed before because the pip install archery[lint] step was being cached from docker.

Example of lint with old version:

$ pip freeze | grep flake8
flake8==4.0.1
$ archery lint --python 
INFO:archery:Running Python formatter (autopep8)
INFO:archery:Running Python linter (flake8)
INFO:archery:Running Cython linter (cython-lint)

Upgrading to the new version:

$ pip freeze | grep flake8
flake8==6.1.0
$ archery lint --python 
INFO:archery:Running Python formatter (autopep8)
--- original//home/raulcd/code/arrow/python/pyarrow/tests/test_flight.py
+++ fixed//home/raulcd/code/arrow/python/pyarrow/tests/test_flight.py
@@ -1495,7 +1495,7 @@
     """Check that incorrectly overriding the hostname fails."""
     certs = example_tls_certs()
 
-    with ConstantFlightServer(tls_certificates=certs["certificates"]) as s,\
+    with ConstantFlightServer(tls_certificates=certs["certificates"]) as s, \
         flight.connect(('localhost', s.port),
                        tls_root_certs=certs["root_cert"],
                        override_hostname="fakehostname") as client:
--- original//home/raulcd/code/arrow/python/pyarrow/tests/test_dataset.py
+++ fixed//home/raulcd/code/arrow/python/pyarrow/tests/test_dataset.py
@@ -5181,9 +5181,9 @@
                       "a.dotted.field": [1, 2],
                       "interaction": [
         {"type": None, "element": "button",
-         "values": [1, 2], "structs":[{"foo": "bar"}, None]},
+         "values": [1, 2], "structs": [{"foo": "bar"}, None]},
         {"type": "scroll", "element": "window",
-         "values": [None, 3, 4], "structs":[{"fizz": "buzz"}]}
+         "values": [None, 3, 4], "structs": [{"fizz": "buzz"}]}
     ]})
     ds.write_dataset(table, tempdir / "table", format=format)
     ds1 = ds.dataset(tempdir / "table", format=format)

INFO:archery:Running Python linter (flake8)
/home/raulcd/code/arrow/python/pyarrow/tests/test_array.py:304:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_csv.py:1939:24: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_dataset.py:5024:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_dataset.py:5184:37: E231 missing whitespace after ':'
/home/raulcd/code/arrow/python/pyarrow/tests/test_dataset.py:5186:43: E231 missing whitespace after ':'
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:343:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:344:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:740:21: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:802:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:810:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:833:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:1264:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_extension_type.py:1272:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_flight.py:1498:75: E231 missing whitespace after ','
/home/raulcd/code/arrow/python/pyarrow/tests/test_table.py:514:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
/home/raulcd/code/arrow/python/pyarrow/tests/test_table.py:952:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
INFO:archery:Running Cython linter (cython-lint)

Component(s)

Continuous Integration, Python

@danepitkin
Copy link
Contributor

I can fix this!

danepitkin added a commit to danepitkin/arrow that referenced this issue Aug 1, 2023
raulcd pushed a commit that referenced this issue Aug 1, 2023
…36976)

### Rationale for this change

Fix archery lint issues with new version of flake8 dependency.

### What changes are included in this PR?

* Lint errors.

### Are these changes tested?

Yes.

```
$ flake8 --version
6.1.0 (mccabe: 0.7.0, pycodestyle: 2.11.0, pyflakes: 3.1.0) CPython 3.11.4 on Darwin
$ archery lint --python
INFO:archery:Running Python formatter (autopep8)
INFO:archery:Running Python linter (flake8)
INFO:archery:Running Cython linter (cython-lint)
$
```

### Are there any user-facing changes?

No
* Closes: #36973

Authored-by: Dane Pitkin <dane@voltrondata.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
@raulcd raulcd added this to the 14.0.0 milestone Aug 1, 2023
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
….1.0 (apache#36976)

### Rationale for this change

Fix archery lint issues with new version of flake8 dependency.

### What changes are included in this PR?

* Lint errors.

### Are these changes tested?

Yes.

```
$ flake8 --version
6.1.0 (mccabe: 0.7.0, pycodestyle: 2.11.0, pyflakes: 3.1.0) CPython 3.11.4 on Darwin
$ archery lint --python
INFO:archery:Running Python formatter (autopep8)
INFO:archery:Running Python linter (flake8)
INFO:archery:Running Cython linter (cython-lint)
$
```

### Are there any user-facing changes?

No
* Closes: apache#36973

Authored-by: Dane Pitkin <dane@voltrondata.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants