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

[Housekeeping] Remove deprecated numpy aliases #3166

Closed
2 tasks done
eapolinario opened this issue Dec 19, 2022 · 4 comments
Closed
2 tasks done

[Housekeeping] Remove deprecated numpy aliases #3166

eapolinario opened this issue Dec 19, 2022 · 4 comments
Assignees
Labels
flytekit FlyteKit Python related issue housekeeping Issues that help maintain flyte and keep it tech-debt free

Comments

@eapolinario
Copy link
Contributor

Describe the issue

A few aliases defined in numpy were deprecated in v1.20.0 and finally removed in v1.24.0 (check Deprecations in https://github.com/numpy/numpy/releases/tag/v1.20.0).

We should remove the mentions to those deprecated aliases from the FlyteSchemaTransformer.

What if we do not do this?

Users who install numpy>=1.24.0 will see this error in flytekit:

/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/flytekit/types/schema/types.py:324: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  _np.bool: SchemaType.SchemaColumn.SchemaColumnType.BOOLEAN,  # type: ignore
Traceback (most recent call last):
  File "/tmp/tmp.pgqfAvNZOC/venv/bin/pyflyte", line 5, in <module>
    from flytekit.clis.sdk_in_container.pyflyte import main
  File "/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/flytekit/__init__.py", line 195, in <module>
    from flytekit.types import directory, file, numpy, schema
  File "/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/flytekit/types/schema/__init__.py", line 1, in <module>
    from .types import (
  File "/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/flytekit/types/schema/types.py", line 314, in <module>
    class FlyteSchemaTransformer(TypeTransformer[FlyteSchema]):
  File "/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/flytekit/types/schema/types.py", line 324, in FlyteSchemaTransformer
    _np.bool: SchemaType.SchemaColumn.SchemaColumnType.BOOLEAN,  # type: ignore
  File "/tmp/tmp.pgqfAvNZOC/venv/lib/python3.10/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool'. Did you mean: 'bool_'?

Related component(s)

flytekit

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@eapolinario eapolinario added housekeeping Issues that help maintain flyte and keep it tech-debt free flytekit FlyteKit Python related issue labels Dec 19, 2022
skrawcz added a commit to stitchfix/hamilton that referenced this issue Dec 19, 2022
So that the pyspark test doesn't fail.

Why is it failing? Well it appears that ([source](flyteorg/flyte#3166)):
> A few aliases defined in numpy were deprecated in v1.20.0 and finally removed in v1.24.0

And pyspark hasn't updated to not use it.
@eapolinario eapolinario self-assigned this Dec 20, 2022
@github-actions
Copy link

Hello 👋, This issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will close the issue if we detect no activity in the next 7 days. Thank you for your contribution and understanding! 🙏

@github-actions github-actions bot added the stale label Sep 17, 2023
@github-actions
Copy link

Hello 👋, This issue has been inactive for over 9 months and hasn't received any updates since it was marked as stale. We'll be closing this issue for now, but if you believe this issue is still relevant, please feel free to reopen it. Thank you for your contribution and understanding! 🙏

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2023
@eapolinario eapolinario reopened this Nov 2, 2023
@github-actions github-actions bot removed the stale label Nov 4, 2023
@dennisobrien
Copy link

It looks like one of these changes has already been made in the PR flytekit#1557

-        _np.bool: SchemaType.SchemaColumn.SchemaColumnType.BOOLEAN,  # type: ignore
+        _np.bool_: SchemaType.SchemaColumn.SchemaColumnType.BOOLEAN,  # type: ignore

I've verified that all the numpy types referenced in FlyteSchemaTransformer are valid for numpy version 1.26.4. So maybe the only work that needs to be done here is to relax the version constraint on numpy?

@eapolinario
Copy link
Contributor Author

Fixed by flyteorg/flytekit#2483.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flytekit FlyteKit Python related issue housekeeping Issues that help maintain flyte and keep it tech-debt free
Projects
None yet
Development

No branches or pull requests

2 participants