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

chore(ci): fix numpy type errors and revert #22610 #22782

Merged
merged 7 commits into from
Jan 19, 2023

Conversation

villebro
Copy link
Member

@villebro villebro commented Jan 19, 2023

SUMMARY

Fix recently introduced typing errors that are blocking CI:
image

In addition, revert #22610, as it broke SQL Lab. Without the revert, SQL Lab loads without the top nav:
image

With the revert, SQL Lab loads properly again:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

if df.dtypes[column] == np.object:
if df.dtypes[column] == np.object_:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nowadays np.object is the same as object:

>>> import numpy as np
>>> np.object
<stdin>:1: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
<class 'object'>

I'm opting for np.object_ here as it seems cleaner and it also worked (there's a unit test for this, so we'll catch this if it changes in the future). Check https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations 👍
image

result = np.copy(array)

with np.nditer(result, flags=["refs_ok"], op_flags=["readwrite"]) as it:
with np.nditer(result, flags=["refs_ok"], op_flags=[["readwrite"]]) as it:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this actually caught an incorrect type!

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 19, 2023
Comment on lines -20 to +22
description-file = README.md
description_file = README.md
author = Apache Superset Dev
author-email = dev@superset.apache.org
author_email = dev@superset.apache.org
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bycatch; noticed this was being emitted by pylint:

/Users/ville/apple/apache-superset/.tox/pylint/lib/python3.8/site-packages/setuptools/dist.py:770: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
/Users/ville/apple/apache-superset/.tox/pylint/lib/python3.8/site-packages/setuptools/dist.py:770: UserWarning: Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #22782 (a1b4286) into master (5026da5) will decrease coverage by 11.29%.
The diff coverage is 91.58%.

❗ Current head a1b4286 differs from pull request most recent head 65724f3. Consider uploading reports for the commit 65724f3 to get more accurate results

@@             Coverage Diff             @@
##           master   #22782       +/-   ##
===========================================
- Coverage   67.27%   55.99%   -11.29%     
===========================================
  Files        1875     1876        +1     
  Lines       71820    71880       +60     
  Branches     7870     7867        -3     
===========================================
- Hits        48319    40246     -8073     
- Misses      21473    29607     +8134     
+ Partials     2028     2027        -1     
Flag Coverage Δ
hive 52.61% <61.90%> (+<0.01%) ⬆️
mysql ?
postgres ?
presto 52.50% <61.90%> (+<0.01%) ⬆️
python 58.30% <95.23%> (-23.59%) ⬇️
sqlite ?
unit 51.54% <71.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/App.jsx 0.00% <ø> (ø)
...uperset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx 0.00% <0.00%> (ø)
...et-frontend/src/dashboard/components/Dashboard.jsx 65.51% <ø> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 7.14% <ø> (ø)
superset-frontend/src/views/components/Menu.tsx 49.23% <ø> (ø)
...erset-frontend/src/SqlLab/components/App/index.jsx 57.14% <50.00%> (-0.76%) ⬇️
...qlLab/components/EstimateQueryCostButton/index.tsx 60.86% <50.00%> (-1.04%) ⬇️
superset/db_engine_specs/hive.py 64.72% <50.00%> (-22.44%) ⬇️
...rontend/src/dashboard/components/DashboardGrid.jsx 58.49% <66.66%> (+3.13%) ⬆️
...d/components/DashboardBuilder/DashboardBuilder.tsx 74.50% <85.71%> (-0.04%) ⬇️
... and 333 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@villebro villebro changed the title chore(lint): fix numpy type errors chore(lint): fix numpy type errors and revert #22610 Jan 19, 2023
@villebro villebro changed the title chore(lint): fix numpy type errors and revert #22610 chore(ci): fix numpy type errors and revert #22610 Jan 19, 2023
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dev = request.args.get("testing")
if dev is not None:
return super().render_app_template()
return redirect("/")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this? ^^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from the revert, not my change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked blame, the original code is from this PR: #20869

@villebro villebro merged commit 577ac81 into apache:master Jan 19, 2023
@villebro villebro deleted the villebro/numpy-lint branch January 19, 2023 12:53
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants