Skip to content

Commit 96790bf

Browse files
feat: Support numpy 2.0 (#2944)
* feat: Support numpy 2.0 This reverts commit 9200639. * override Numpy version in layer * change order of pip install commands * fix numpy override
1 parent 0d95849 commit 96790bf

File tree

4 files changed

+53
-41
lines changed

4 files changed

+53
-41
lines changed

awswrangler/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def split_pandas_frame(df: pd.DataFrame, splits: int) -> list[pd.DataFrame]:
857857
total = len(df)
858858
each_section, extras = divmod(total, splits)
859859
section_sizes = [0] + extras * [each_section + 1] + (splits - extras) * [each_section]
860-
div_points = _nx.array(section_sizes, dtype=_nx.intp).cumsum() # type: ignore[attr-defined]
860+
div_points = _nx.array(section_sizes, dtype=_nx.intp).cumsum()
861861

862862
sub_dfs = []
863863
for i in range(splits):

building/lambda/build-lambda-layer.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ pushd /aws-sdk-pandas
8383

8484
pip3 install . -t ./python ".[redshift,mysql,postgres,gremlin,opensearch,openpyxl]"
8585

86+
# Install Numpy 1.x because 2.x is not support in layers right now
87+
pip3 install -t ./python --upgrade "numpy==1.*"
88+
8689
rm -rf python/pyarrow*
8790
rm -rf python/boto*
8891
rm -rf python/urllib3*

poetry.lock

Lines changed: 47 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ pandas = [
3636
{ version = ">=1.2.0,<3.0.0", markers = "python_version >= \"3.9\"" },
3737
]
3838
numpy = [
39-
{version = "^1.18", markers = "python_version < \"3.12\""},
40-
{version = "^1.26", markers = "python_version >= \"3.12\""}
39+
{ version = ">=1.18,<2.0", markers = "python_version < \"3.9\"" },
40+
{ version = ">=1.26,<3.0", markers = "python_version >= \"3.9\"" }
4141
]
4242
pyarrow = ">=8.0.0"
4343
typing-extensions = "^4.4.0"

0 commit comments

Comments
 (0)