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: duplicate entries in /grants/report API #6830

Merged

Conversation

sebastiantf
Copy link
Contributor

Description

It seems the current output from the /grants/report/ endpoint contains duplicate entries, which is supposedly causing a performance issue at the endpoint, ultimately leading to a 502: #6633 (comment)

https://gitcoin.co/api/v0.1/grants/report/?eth_address=0xC0eBeFadCbF1d2A85fBfDDC226a95860F5152b5f&from_timestamp=2019-05-01T01:24:15Z&to_timestamp=2020-06-09T01:24:15Z

This PR prevents the duplicate entries to appear in the API response.

Refers/Fixes

Refers/Fixes/Follow-up to: #6633
Refers/Fixes/Follow-up to: #6633 (comment)

Testing

Before:

grants_report_api_bugfix_before

After:

grants_report_api_bugfix_after

@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #6830 into master will increase coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6830      +/-   ##
==========================================
+ Coverage   26.65%   26.67%   +0.02%     
==========================================
  Files         294      294              
  Lines       28134    28135       +1     
  Branches     4139     4139              
==========================================
+ Hits         7498     7504       +6     
+ Misses      20370    20365       -5     
  Partials      266      266              
Impacted Files Coverage Δ
app/grants/router.py 32.83% <0.00%> (-0.50%) ⬇️
app/dashboard/embed.py 31.60% <0.00%> (+3.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 2a5c603...49260e5. Read the comment docs.

@thelostone-mc thelostone-mc merged commit 14fcbf5 into gitcoinco:master Jun 23, 2020
@danlipert
Copy link
Contributor

@thelostone-mc @sebastiantf I couldn't get this to work locally using the example you provided with a copy of the prod grants data in my local

@sebastiantf
Copy link
Contributor Author

sebastiantf commented Jun 23, 2020

@danlipert The example uses an eth_address that's not available in the prod grants data. Try using 0x240dA283477044D2cA519C8e068BC489E20b573d or any other admin_address with amount_received > 0 from https://gitcoin.co/api/v0.1/grants/

Or maybe the API isn't deployed yet?

@danlipert
Copy link
Contributor

ah nvm i got it working 👍

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