Skip to content
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

Fix: Fix deprecated numpy type and make numpy<2 explicit dependency #2483

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

fg91
Copy link
Member

@fg91 fg91 commented Jun 16, 2024

Why are the changes needed?

Today, numpy==2.0.0 was released. This new release broke the sandbox-bundled-functional-tests in flyteorg/flyte#4726:

Collecting numpy>=1.26.0 (from pandas->flytekitplugins-deck-standard)
  Downloading numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
...
Failed with Unknown Exception <class 'AttributeError'> Reason: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.
...
File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/flytekit/types/schema/types.py", line 340, in FlyteSchemaTransformer
    _np.string_: SchemaType.SchemaColumn.SchemaColumnType.STRING,
    ^^^^^^^^^^^

The docs of numpy 1.26 also show that string_ is just an alias to bytes_.


I noticed that numpy isn't an explicit flytekit dependency even though flytekit imports numpy. I fix this as well and pin numpy to <2 for now as CI jobs of several plugins fail with numpy errors currently.


  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Fabio Grätz added 2 commits June 16, 2024 17:51
Signed-off-by: Fabio Grätz <[email protected]>
@fg91 fg91 changed the title Fix: Fix deprecated numpy type and make numpy explicit dependency Fix: Fix deprecated numpy type and make numpy<2 explicit dependency Jun 16, 2024
@fg91 fg91 merged commit a902471 into master Jun 17, 2024
44 of 46 checks passed
bgedik pushed a commit to bgedik/flytekit that referenced this pull request Jul 3, 2024
…lyteorg#2483)

* Replace deprecated np.string_ with np.bytes_ (alias)

Signed-off-by: Fabio Grätz <[email protected]>

* Make numpy an explicit dependency

Signed-off-by: Fabio Grätz <[email protected]>

* Pin numpy to <2

Signed-off-by: Fabio Grätz <[email protected]>

---------

Signed-off-by: Fabio Grätz <[email protected]>
Co-authored-by: Fabio Grätz <[email protected]>
Signed-off-by: bugra.gedik <[email protected]>
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
…2483)

* Replace deprecated np.string_ with np.bytes_ (alias)

Signed-off-by: Fabio Grätz <[email protected]>

* Make numpy an explicit dependency

Signed-off-by: Fabio Grätz <[email protected]>

* Pin numpy to <2

Signed-off-by: Fabio Grätz <[email protected]>

---------

Signed-off-by: Fabio Grätz <[email protected]>
Co-authored-by: Fabio Grätz <[email protected]>
Signed-off-by: Jan Fiedler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants