Skip to content

More contribs client patches#1095

Merged
esoteric-ephemera merged 1 commit into
mainfrom
patcheroo
May 12, 2026
Merged

More contribs client patches#1095
esoteric-ephemera merged 1 commit into
mainfrom
patcheroo

Conversation

@esoteric-ephemera
Copy link
Copy Markdown
Collaborator

  • Patch query_projects:
    • Correct data concatenation to return a list of projects
    • Allow for pagination when "page" is present in query

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.61%. Comparing base (a2b2fc0) to head (11bdf56).

Files with missing lines Patch % Lines
mp_api/client/contribs/client.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1095   +/-   ##
=======================================
  Coverage   73.61%   73.61%           
=======================================
  Files          56       56           
  Lines        4249     4249           
=======================================
  Hits         3128     3128           
  Misses       1121     1121           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@minhsueh
Copy link
Copy Markdown

minhsueh commented May 9, 2026

Is there a way to get the total_count for the retrieved list data? I'm looking for something similar to raw_data.get("total_count"), as calculating it manually via len(raw_data) or max() doesn't accurately reflect the full dataset in a paginated environment.

                if isinstance(raw_data, dict):
                    # Large dataset: API returns {"data": [...], "total_count": N}
                    self.total_count = raw_data.get("total_count", 0)
                    processed_data = self.abc_special_data_entry(raw_data)
                elif isinstance(raw_data, list):
                    # Small dataset: API returns [...] directly, all data is here
                    processed_data = raw_data
                    self.total_count = max(self.total_count, len(raw_data))

@esoteric-ephemera
Copy link
Copy Markdown
Collaborator Author

esoteric-ephemera commented May 11, 2026

Sure but for the project, contributions, something else? Approach will be slightly different by endpoint

Scratch that, there's already a get_totals function to do this

@minhsueh
Copy link
Copy Markdown

Great! Exactly what I need!

@esoteric-ephemera esoteric-ephemera merged commit 64c0ae9 into main May 12, 2026
6 checks passed
@esoteric-ephemera esoteric-ephemera deleted the patcheroo branch May 12, 2026 19:38
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