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: expire is a keyword argument for beaker cache #239

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

tianruzhou-db
Copy link
Contributor

@tianruzhou-db tianruzhou-db commented Dec 7, 2020

Summary of Changes

Change expire from positional argument to keyword argument.
Or cache will never be refreshed.

Tests

Write a simple getRandNum function locally:

@_CACHE.cache('test', 1)
def getRandNum(input):
    return random.randint(0, 10)

If I treat expire as a positional argument, above function will always return the same value.
However, after I change it to keyword argument:

@_CACHE.cache('test', expire=1)
def getRandNum(input):
    return random.randint(0, 10)

The value will change every second.

Documentation

What documentation did you add or modify and why? Add any relevant links then remove this line

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
  • PR passes make test

@codecov-io
Copy link

Codecov Report

Merging #239 (2c9230d) into master (2752492) will increase coverage by 2.59%.
The diff coverage is 70.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   74.10%   76.69%   +2.59%     
==========================================
  Files          25       27       +2     
  Lines        1255     1326      +71     
  Branches      136      159      +23     
==========================================
+ Hits          930     1017      +87     
+ Misses        297      265      -32     
- Partials       28       44      +16     
Impacted Files Coverage Δ
metadata_service/api/popular_tables.py 100.00% <ø> (ø)
metadata_service/api/user.py 100.00% <ø> (ø)
metadata_service/proxy/shared.py 28.57% <28.57%> (ø)
metadata_service/proxy/neo4j_proxy.py 71.46% <57.14%> (-3.54%) ⬇️
metadata_service/api/badge.py 61.29% <61.29%> (ø)
metadata_service/proxy/base_proxy.py 67.08% <75.00%> (-0.06%) ⬇️
metadata_service/proxy/atlas_proxy.py 80.34% <79.19%> (-3.97%) ⬇️
metadata_service/__init__.py 76.47% <100.00%> (ø)
metadata_service/api/dashboard.py 81.81% <100.00%> (+8.48%) ⬆️
metadata_service/api/table.py 100.00% <100.00%> (ø)
... and 10 more

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 5680775...2c9230d. Read the comment docs.

@feng-tao feng-tao merged commit a7b2ec5 into amundsen-io:master Dec 7, 2020
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.

3 participants