Skip to content

Commit

Permalink
33 update for 312 (#34)
Browse files Browse the repository at this point in the history
* lock file

* test with 3.12

* typing

* typing

* Update ci.yml

* union
  • Loading branch information
tschm authored Dec 22, 2023
1 parent 95a4528 commit 8be9c6f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: "ci"

on:
push:
branches:
- main
push

jobs:
test:
Expand All @@ -13,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: ['3.9', '3.10', '3.11'] # '3.12.0-rc.3' pyarrow fails to build for 3.12
python-version: ['3.9', '3.10', '3.11', '3.12'] # '3.12.0-rc.3' pyarrow fails to build for 3.12

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion cvx/bson/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from cvx.bson.io import decode, encode

FILE = Union[str, bytes, PathLike]
MATRIX: TypeAlias = npt.NDArray[Any] | pd.DataFrame
MATRIX: TypeAlias = Union[npt.NDArray[Any], pd.DataFrame]
MATRICES = Dict[str, MATRIX]


Expand Down
6 changes: 3 additions & 3 deletions cvx/bson/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from io import BytesIO
from typing import Any
from typing import Any, Union

import numpy as np
import pandas as pd
import pyarrow as pa


def encode(data: np.ndarray | pd.DataFrame) -> Any:
def encode(data: Union[np.ndarray, pd.DataFrame]) -> Any:
"""
Encode a numpy array or a pandas DataFrame
Expand All @@ -40,7 +40,7 @@ def encode(data: np.ndarray | pd.DataFrame) -> Any:
raise TypeError(f"Invalid Datatype {type(data)}")


def decode(data: bytes) -> np.ndarray | pd.DataFrame:
def decode(data: bytes) -> Union[np.ndarray, pd.DataFrame]:
"""
Decode the bytes back into numpy array or pandas DataFrame
Expand Down
5 changes: 3 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = [{include = "cvx"}]
homepage = "https://www.cvxgrp.org/cvxbson"

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python = ">=3.9,<3.13"
numpy = "*"
numpyencoder = "*"
pandas = "*"
Expand Down

0 comments on commit 8be9c6f

Please sign in to comment.