Skip to content

Commit

Permalink
Merge branch 'master' into add_script_to_run_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samer-hamood authored Jan 28, 2025
2 parents c53f968 + 316a194 commit 96ee62b
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 229 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- python-version: "3.11"
use_pandas: 1
Expand All @@ -26,7 +26,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: poetry install
- run: |
if ! poetry install; then
poetry lock
poetry install
fi
- name: Pylint
run: poetry run pylint functional
- name: black
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Release 1.6

- Added [run-test.sh](run-tests.sh) script that runs all checks on code
- Added support for Python 3.12 and 3.13 by upgrading Pylint and disabling/fixing Pylint errors
- Corrected and improved language consistency in [readme](README.md) and `CHANGELOG.md`

## Release 1.5
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ In order to be merged, all pull requests must:

## Supported Python Versions

- `PyFunctional` 1.6 is tested against Python 3.12 and Python 3.13.
- `PyFunctional` 1.5 is tested against Python 3.8 to 3.11. PyPy3 is not tested, but bug fixed on best effort basis.
- `PyFunctional` 1.4 supports and is tested against Python 3.6, Python 3.7, and PyPy3
- `PyFunctional` 1.4 and above do not support python 2.7
Expand Down
12 changes: 12 additions & 0 deletions functional/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class ReusableFile(Generic[_FileConv_co]):
lazy.
"""

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
# pylint: disable=too-many-instance-attributes
def __init__(
self,
Expand Down Expand Up @@ -84,6 +86,8 @@ def read(self):
class CompressedFile(ReusableFile):
magic_bytes: bytes | None = None

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
# pylint: disable=too-many-instance-attributes
def __init__(
self,
Expand Down Expand Up @@ -115,6 +119,8 @@ def is_compressed(cls, data):
class GZFile(CompressedFile):
magic_bytes: bytes = b"\x1f\x8b\x08"

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
# pylint: disable=too-many-instance-attributes
def __init__(
self,
Expand Down Expand Up @@ -170,6 +176,8 @@ def read(self):
class BZ2File(CompressedFile):
magic_bytes: bytes = b"\x42\x5a\x68"

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
# pylint: disable=too-many-instance-attributes
def __init__(
self,
Expand Down Expand Up @@ -220,6 +228,8 @@ class XZFile(CompressedFile):
magic_bytes: bytes = b"\xfd\x37\x7a\x58\x5a\x00"

# pylint: disable=too-many-instance-attributes
# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def __init__(
self,
path,
Expand Down Expand Up @@ -294,6 +304,8 @@ def get_read_function(filename: str, disable_compression: bool):
return ReusableFile


# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def universal_write_open(
path: str,
mode: str,
Expand Down
8 changes: 8 additions & 0 deletions functional/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class Sequence(Generic[_T_co]):
functional transformations and reductions in a data pipeline style
"""

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def __init__(
self,
sequence: Iterable[_T_co],
Expand Down Expand Up @@ -443,6 +445,8 @@ def cartesian(
) -> Sequence[tuple[_T_co, _T1, _T2, _T3, _T4]]:
...

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
@overload
def cartesian(
self,
Expand All @@ -455,6 +459,8 @@ def cartesian(
) -> Sequence[tuple[_T_co, _T1, _T2, _T3, _T4, _T5]]:
...

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
@overload
def cartesian(
self,
Expand Down Expand Up @@ -1758,6 +1764,8 @@ def dict(self, default=None): # pyright: ignore[reportInconsistentOverload]
return self.to_dict(default=default) # type: ignore

# pylint: disable=too-many-locals
# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def to_file(
self,
path: str,
Expand Down
4 changes: 4 additions & 0 deletions functional/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def _parse_args(
no_wrap=_no_wrap,
)

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def open(
self,
path: str,
Expand Down Expand Up @@ -233,6 +235,8 @@ def csv(
csv_input = csvapi.reader(input_file, dialect=dialect, **fmt_params)
return self(csv_input).cache(delete_lineage=True)

# pylint: disable=unknown-option-value
# pylint: disable=too-many-positional-arguments
def csv_dict_reader(
self,
csv_file: str | Iterator[str],
Expand Down
2 changes: 1 addition & 1 deletion functional/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def grouped_impl(size, sequence):
batch = islice(iterator, size)
yield list(chain((next(batch),), batch))
except StopIteration:
return
pass


def grouped_t(size):
Expand Down
Loading

0 comments on commit 96ee62b

Please sign in to comment.