Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ repos:
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/pylint
rev: v2.14.2
hooks:
- id: pylint
args: [ --rcfile=python/pylintrc ]
342 changes: 295 additions & 47 deletions python/poetry.lock

Large diffs are not rendered by default.

46 changes: 1 addition & 45 deletions python/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ disable=all
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=spelling,W
enable=W


[REPORTS]
Expand Down Expand Up @@ -151,50 +151,6 @@ logging-format-style=old
# function parameter format.
logging-modules=logging


[SPELLING]

# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4

# Spelling dictionary name. Available dictionaries: af (aspell), am (aspell),
# ar (aspell), ast (aspell), az (aspell), be (aspell), be_BY (aspell), be_SU
# (aspell), bg (aspell), bn (aspell), br (aspell), ca (aspell), cs (aspell),
# csb (aspell), cy (aspell), da (aspell), de (aspell), de_AT (aspell), de_CH
# (aspell), de_DE (aspell), el (aspell), en (aspell), en_AU (aspell), en_CA
# (aspell), en_GB (aspell), en_US (aspell), eo (aspell), es (aspell), es_ES
# (AppleSpell), et (aspell), fa (aspell), fi (aspell), fo (aspell), fr
# (aspell), fr_CH (aspell), fr_FR (aspell), fy (aspell), ga (aspell), gd
# (aspell), gl (aspell), gr (aspell), grc (aspell), gu (aspell), gv (aspell),
# he (aspell), hi (aspell), hil (aspell), hr (aspell), hsb (aspell), hu
# (aspell), hu_HU (AppleSpell), hus (aspell), hy (aspell), ia (aspell), id
# (aspell), it (aspell), it_IT (AppleSpell), kn (aspell), ku (aspell), ky
# (aspell), la (aspell), lt (aspell), lv (aspell), mg (aspell), mi (aspell), mk
# (aspell), ml (aspell), mn (aspell), mr (aspell), ms (aspell), mt (aspell),
# nds (aspell), nl (aspell), nl_NL (AppleSpell), nn (aspell), ny (aspell), or
# (aspell), pa (aspell), pl (aspell), pt_BR (aspell), pt_PT (aspell), qu
# (aspell), ro (aspell), ru (aspell), rw (aspell), sc (aspell), sk (aspell),
# sk_SK (aspell), sl (aspell), sr (aspell), srd (aspell), sv (aspell), sv_SE
# (AppleSpell), sw (aspell), ta (aspell), te (aspell), tet (aspell), tk
# (aspell), tl (aspell), tn (aspell), tr (aspell), uk (aspell), uz (aspell), vi
# (aspell), wa (aspell), yi (aspell), zu (aspell).
spelling-dict=en_US

# List of comma separated words that should be considered directives if they
# appear and the beginning of a comment and should not be checked.
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:

# List of comma separated words that should not be checked.
spelling-ignore-words=

# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=spellcheck-dictionary.txt

# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
Expand Down
1 change: 0 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ packages = [
[tool.poetry.dependencies]
python = "^3.8"
mmh3 = "^3.0.0"

pyarrow = { version = "^8.0.0", optional = true }

[tool.poetry.dev-dependencies]
Expand Down
59 changes: 0 additions & 59 deletions python/spellcheck-dictionary.txt

This file was deleted.

10 changes: 5 additions & 5 deletions python/src/iceberg/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,23 +281,23 @@ def _(self, value: int) -> str:
return self._int_to_human_string(self._type, value)

@singledispatchmethod
def _int_to_human_string(self, value_type: IcebergType, value: int) -> str:
def _int_to_human_string(self, _: IcebergType, value: int) -> str:
return str(value)

@_int_to_human_string.register(DateType)
def _(self, value_type: IcebergType, value: int) -> str:
def _(self, _: IcebergType, value: int) -> str:
return datetime.to_human_day(value)

@_int_to_human_string.register(TimeType)
def _(self, value_type: IcebergType, value: int) -> str:
def _(self, _: IcebergType, value: int) -> str:
return datetime.to_human_time(value)

@_int_to_human_string.register(TimestampType)
def _(self, value_type: IcebergType, value: int) -> str:
def _(self, _: IcebergType, value: int) -> str:
return datetime.to_human_timestamp(value)

@_int_to_human_string.register(TimestamptzType)
def _(self, value_type: IcebergType, value: int) -> str:
def _(self, _: IcebergType, value: int) -> str:
return datetime.to_human_timestamptz(value)


Expand Down
4 changes: 2 additions & 2 deletions python/tests/io/test_io_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def delete(self, location: Union[str, InputFile, OutputFile]) -> None:
try:
os.remove(parsed_location.path)
except FileNotFoundError as e:
raise FileNotFoundError(f"Cannot delete file, does not exist: {parsed_location.path} - Caused by: {e}")
raise FileNotFoundError(f"Cannot delete file, does not exist: {parsed_location.path}") from e


@pytest.mark.parametrize("CustomInputFile", [LocalInputFile, PyArrowFile])
Expand Down Expand Up @@ -322,7 +322,7 @@ def test_raise_file_not_found_error_for_fileio_delete(CustomFileIO):
with pytest.raises(FileNotFoundError) as exc_info:
file_io.delete(output_file_location)

assert (f"Cannot delete file") in str(exc_info.value)
assert "Cannot delete file" in str(exc_info.value)

# Confirm that the file no longer exists
assert not os.path.exists(output_file_location)
Expand Down
1 change: 1 addition & 0 deletions python/tests/io/test_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=W0212,W0613
Comment thread
Fokko marked this conversation as resolved.
Outdated

import os
import tempfile
Expand Down
2 changes: 2 additions & 0 deletions python/tests/utils/test_schema_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=W0212

import pytest

from iceberg.schema import Schema
Expand Down