Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
python: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand All @@ -52,4 +52,3 @@ jobs:
pip install -U tox-gh-actions
- working-directory: ./python
run: tox

2 changes: 1 addition & 1 deletion python/.python-version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
3.7.12
3.8.12
3.9.10
3.10.4
6 changes: 2 additions & 4 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ license_files =
classifiers =
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

[options]
package_dir =
= src
packages = find:
python_requires = >=3.7
python_requires = >=3.8
install_requires =
mmh3
singledispatch
cached-property; python_version <= '3.7'
[options.extras_require]
arrow =
pyarrow
Expand Down
23 changes: 8 additions & 15 deletions python/src/iceberg/expressions/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,11 @@
# pylint: disable=W0613

import struct
import sys
from decimal import ROUND_HALF_UP, Decimal
from functools import singledispatch
from functools import singledispatch, singledispatchmethod
from typing import Optional, Union
from uuid import UUID

from iceberg.utils.datetime import (
date_to_days,
micros_to_days,
time_to_micros,
timestamp_to_micros,
timestamptz_to_micros,
)

if sys.version_info >= (3, 8):
from functools import singledispatchmethod # pragma: no cover
else:
from singledispatch import singledispatchmethod # pragma: no cover

from iceberg.expressions.base import Literal
from iceberg.types import (
BinaryType,
Expand All @@ -58,6 +44,13 @@
TimeType,
UUIDType,
)
from iceberg.utils.datetime import (
date_to_days,
micros_to_days,
time_to_micros,
timestamp_to_micros,
timestamptz_to_micros,
)


@singledispatch
Expand Down
8 changes: 1 addition & 7 deletions python/src/iceberg/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@

from __future__ import annotations

import sys
from abc import ABC, abstractmethod
from dataclasses import dataclass
from functools import singledispatch
from typing import Any, Dict, Generic, Iterable, List, Optional, TypeVar

from iceberg.files import StructProtocol

if sys.version_info >= (3, 8):
from functools import singledispatch # pragma: no cover
else:
from singledispatch import singledispatch # pragma: no cover

from iceberg.types import (
IcebergType,
ListType,
Expand Down
8 changes: 1 addition & 7 deletions python/src/iceberg/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@
Notes:
- https://iceberg.apache.org/#spec/#primitive-types
"""
import sys
from dataclasses import dataclass, field
from functools import cached_property
from typing import ClassVar, Dict, List, Optional, Tuple

if sys.version_info >= (3, 8):
from functools import cached_property
else:
# In the case of <= Python 3.7
from cached_property import cached_property


class Singleton:
_instance = None
Expand Down
4 changes: 2 additions & 2 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

[tox]
envlist = py37,py38,py39,linters
envlist = py38,py39,py310,linters
skip_missing_interpreters = true

[testenv]
Expand Down Expand Up @@ -97,9 +97,9 @@ addopts = --doctest-modules

[gh-actions]
python =
3.7: py37
3.8: py38, linters
3.9: py39
3.10: py310

[mypy]

Expand Down