Skip to content

Build: Bump actions/upload-artifact from 3 to 4 #2

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: ls -lah dist/* && cp dist/* wheelhouse/

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "release-${{ github.event.inputs.version }}"
path: ./wheelhouse/*
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ repos:
- id: ruff-format
args: [ --preview ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.6.1
hooks:
- id: mypy
args:
[--install-types, --non-interactive, --config=pyproject.toml]
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
rev: v2.3.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
Expand Down
17 changes: 0 additions & 17 deletions pyiceberg/avro/decoder_fast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,37 @@ from pyiceberg.avro.decoder import BinaryDecoder
class CythonBinaryDecoder(BinaryDecoder):
def __init__(self, input_contents: bytes) -> None:
pass

def tell(self) -> int:
pass

def read(self, n: int) -> bytes:
pass

def read_boolean(self) -> bool:
pass

def read_int(self) -> int:
pass

def read_ints(self, count: int) -> tuple[int, ...]:
pass

def read_int_bytes_dict(self, count: int, dest: dict[int, bytes]) -> None:
pass

def read_bytes(self) -> bytes:
pass

def read_float(self) -> float:
pass

def read_double(self) -> float:
pass

def read_utf8(self) -> str:
pass

def skip(self, n: int) -> None:
pass

def skip_int(self) -> None:
pass

def skip_boolean(self) -> None:
pass

def skip_float(self) -> None:
pass

def skip_double(self) -> None:
pass

def skip_bytes(self) -> None:
pass

def skip_utf8(self) -> None:
pass
4 changes: 3 additions & 1 deletion pyiceberg/avro/decoder_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ unsigned_long_long_array_template = cython.declare(array.array, array.array('Q',

@cython.final
cdef class CythonBinaryDecoder:
"""Implement a BinaryDecoder that reads from an in-memory buffer."""
"""Implement a BinaryDecoder that reads from an in-memory buffer.

"""

# This the data that is duplicated when the decoder is created.
cdef unsigned char *_data
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Endpoints:
AUTH_URL = "rest.authorization-url"
HEADER_PREFIX = "header."

NAMESPACE_SEPARATOR = b"\x1f".decode(UTF8)
NAMESPACE_SEPARATOR = b"\x1F".decode(UTF8)


def _retry_hook(retry_state: RetryCallState) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _(primitive_type: DecimalType, value: Decimal) -> bytes:
return decimal_to_bytes(value)


@singledispatch # type: ignore
@singledispatch
def from_bytes(primitive_type: PrimitiveType, b: bytes) -> L: # type: ignore
"""Convert bytes to a built-in python value.

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ def rename_column(self, path_from: Union[str, Tuple[str, ...]], new_name: str) -
from_field_correct_casing = self._schema.find_column_name(field_from.field_id)
if from_field_correct_casing in self._identifier_field_names:
self._identifier_field_names.remove(from_field_correct_casing)
new_identifier_path = f"{from_field_correct_casing[: -len(field_from.name)]}{new_name}"
new_identifier_path = f"{from_field_correct_casing[:-len(field_from.name)]}{new_name}"
self._identifier_field_names.add(new_identifier_path)

return self
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ source = ['pyiceberg/']
[tool.ruff]
src = ['pyiceberg','tests']
extend-exclude = ["dev/provision.py"]
lint.select = [
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
Expand All @@ -793,11 +793,11 @@ lint.select = [
"I", # isort
"UP", # pyupgrade
]
lint.ignore = ["E501","E203","B024","B028","UP037"]
ignore = ["E501","E203","B024","B028","UP037"]

# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = ["ALL"]
lint.unfixable = []
fixable = ["ALL"]
unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
Expand All @@ -823,19 +823,19 @@ exclude = [
"node_modules",
"venv",
]
lint.per-file-ignores = {}
per-file-ignores = {}
# Ignore _all_ violations.
# Same as Black.
line-length = 130

# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.pyupgrade]
[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.ruff.lint.isort]
[tool.ruff.isort]
detect-same-package = true
lines-between-types = 0
known-first-party = ["pyiceberg", "tests"]
Expand Down
10 changes: 5 additions & 5 deletions tests/avro/test_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ def test_read_single_byte_at_the_time(decoder_class: Callable[[bytes], BinaryDec

@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
def test_read_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
decoder = decoder_class(b"\x00\x00\x9a\x41")
decoder = decoder_class(b"\x00\x00\x9A\x41")
assert decoder.read_float() == 19.25


@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
def test_skip_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
decoder = decoder_class(b"\x00\x00\x9a\x41")
decoder = decoder_class(b"\x00\x00\x9A\x41")
assert decoder.tell() == 0
decoder.skip_float()
assert decoder.tell() == 4
Expand Down Expand Up @@ -179,21 +179,21 @@ def test_read_bytes(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:

@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
def test_read_utf8(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
decoder = decoder_class(b"\x04\x76\x6f")
decoder = decoder_class(b"\x04\x76\x6F")
assert decoder.read_utf8() == "vo"


@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
def test_skip_utf8(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
decoder = decoder_class(b"\x04\x76\x6f")
decoder = decoder_class(b"\x04\x76\x6F")
assert decoder.tell() == 0
decoder.skip_utf8()
assert decoder.tell() == 3


@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
def test_read_int_as_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
decoder = decoder_class(b"\x00\x00\x9a\x41")
decoder = decoder_class(b"\x00\x00\x9A\x41")
reader = resolve_reader(FloatType(), DoubleType())
assert reader.read(decoder) == 19.25

Expand Down