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

feat: simplify memoized_func #19905

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

betodealmeida
Copy link
Member

SUMMARY

The memoized_func decorator takes a function key to compute the cache key based on the arguments passed to the decorated function. The same behavior can be obtained by simply passing a string as the key, and formatting it using the arguments.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

I added some unit tests.

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

@betodealmeida betodealmeida changed the title feat: simplify memoized_func feat: simplify memoized_func Apr 29, 2022
@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #19905 (0996cbf) into master (9328053) will increase coverage by 0.00%.
The diff coverage is 90.00%.

@@           Coverage Diff           @@
##           master   #19905   +/-   ##
=======================================
  Coverage   66.52%   66.53%           
=======================================
  Files        1714     1714           
  Lines       65032    65036    +4     
  Branches     6717     6717           
=======================================
+ Hits        43260    43269    +9     
+ Misses      20065    20060    -5     
  Partials     1707     1707           
Flag Coverage Δ
hive 52.91% <20.00%> (-0.01%) ⬇️
mysql 81.94% <90.00%> (+0.02%) ⬆️
postgres 81.98% <90.00%> (+0.02%) ⬆️
presto 52.76% <20.00%> (-0.01%) ⬇️
python 82.40% <90.00%> (+0.01%) ⬆️
sqlite 81.74% <90.00%> (+0.01%) ⬆️
unit 48.03% <90.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
superset/models/core.py 89.33% <ø> (ø)
superset/utils/cache.py 75.00% <90.00%> (+0.47%) ⬆️
superset/charts/commands/importers/v1/__init__.py 100.00% <0.00%> (ø)
superset/views/datasource/views.py 96.66% <0.00%> (+6.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9328053...0996cbf. Read the comment docs.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

This is great!

@betodealmeida betodealmeida merged commit aff10a7 into apache:master Apr 29, 2022
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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/M 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants