Skip to content

Fix activity paging when limit exceeds HDX maximum and simplify recent additions - #121

Merged
mcarans merged 1 commit into
mainfrom
fix/activity-paging-and-simplify
Oct 15, 2026
Merged

mcarans merged 1 commit into
mainfrom
fix/activity-paging-and-simplify

Conversation

@mcarans

@mcarans mcarans commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Bug fix

Activity.get_activities(..., all_pages=True, limit=N) with N > 100 returned only the first 100 activities. HDX silently caps limit at ckan.activity_list_limit_max (100, per CKAN's ckanext/activity/logic/schema.py), so the first page came back shorter than the requested limit and paging stopped. _get_list now caps the limit at 100 when paging. The test mock now applies the same cap, and a new test covers limit=500.

Simplifications

  • Moved the duplicated get_activities body in Dataset, Organization, Location and User into HDXObject._get_activities
  • Moved the download code shared by Resource.download and Resource.download_datastore into Resource._download_file. file_format is now lowercased once in download_datastore.
  • User.get_current_token_info uses cls instead of User
  • Collapsed the if/else in the update_hdx_data_dictionary merge loop

…t additions

- Cap activity list limit at 100 when getting all pages, as HDX silently
  caps it and paging stopped after the first page
- Share get_activities body via HDXObject._get_activities
- Share download code between Resource.download and download_datastore
- Use cls in User.get_current_token_info
- Simplify data dictionary merge loop
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Test Results

187 tests  ±0   187 ✅ ±0   1m 21s ⏱️ -6s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit eca1fd6. ± Comparison against base commit 681c722.

♻️ This comment has been updated with latest results.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.319% (-0.001%) from 97.32% — fix/activity-paging-and-simplify into main

@mcarans
mcarans merged commit d0a1a95 into main Oct 15, 2026
6 of 8 checks passed
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.

2 participants