Skip to content

Commit

Permalink
feat: Support numpy 2.0 (#2944)
Browse files Browse the repository at this point in the history
* feat: Support numpy 2.0

This reverts commit 9200639.

* override Numpy version in layer

* change order of pip install commands

* fix numpy override
  • Loading branch information
LeonLuttenberger authored Aug 28, 2024
1 parent 0d95849 commit 96790bf
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 41 deletions.
2 changes: 1 addition & 1 deletion awswrangler/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ def split_pandas_frame(df: pd.DataFrame, splits: int) -> list[pd.DataFrame]:
total = len(df)
each_section, extras = divmod(total, splits)
section_sizes = [0] + extras * [each_section + 1] + (splits - extras) * [each_section]
div_points = _nx.array(section_sizes, dtype=_nx.intp).cumsum() # type: ignore[attr-defined]
div_points = _nx.array(section_sizes, dtype=_nx.intp).cumsum()

sub_dfs = []
for i in range(splits):
Expand Down
3 changes: 3 additions & 0 deletions building/lambda/build-lambda-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ pushd /aws-sdk-pandas

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

# Install Numpy 1.x because 2.x is not support in layers right now
pip3 install -t ./python --upgrade "numpy==1.*"

rm -rf python/pyarrow*
rm -rf python/boto*
rm -rf python/urllib3*
Expand Down
85 changes: 47 additions & 38 deletions poetry.lock

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

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pandas = [
{ version = ">=1.2.0,<3.0.0", markers = "python_version >= \"3.9\"" },
]
numpy = [
{version = "^1.18", markers = "python_version < \"3.12\""},
{version = "^1.26", markers = "python_version >= \"3.12\""}
{ version = ">=1.18,<2.0", markers = "python_version < \"3.9\"" },
{ version = ">=1.26,<3.0", markers = "python_version >= \"3.9\"" }
]
pyarrow = ">=8.0.0"
typing-extensions = "^4.4.0"
Expand Down

0 comments on commit 96790bf

Please sign in to comment.