Skip to content

Conversation

@puntonim
Copy link

@puntonim puntonim commented Dec 12, 2025

The best way to get the details of an activity when not interested in polylines is:

get_activity_details(..., maxploy=0)

The 0 value is allowed by the API.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Relaxed validation constraints for activity details configuration parameters to allow zero as a valid value.

✏️ Tip: You can customize this high-level summary in your review settings.

get_activity_details(..., maxploy=0) is the best way to get the details of an activity when not interested in polylines. The 0 value is allowed.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Modified validation logic in get_activity_details to allow zero values for the maxpoly parameter, changing the validation from requiring strictly positive integers to accepting non-negative integers. URL construction and API call behavior remain unchanged.

Changes

Cohort / File(s) Summary
Parameter validation update
garminconnect/__init__.py
Changed maxpoly parameter validation in get_activity_details from strictly positive (> 0) to non-negative (>= 0), allowing zero as a valid value

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Single file with minimal, localized logic adjustment to parameter validation
  • Low-risk change with no structural or behavioral complexity
  • May warrant verification that allowing maxpoly == 0 is intentional and properly documented

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: allowing the maxpoly argument to accept a value of 0 in get_activity_details().
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e921425 and e074f69.

📒 Files selected for processing (1)
  • garminconnect/__init__.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
garminconnect/**

⚙️ CodeRabbit configuration file

garminconnect/**: - prefer modern Python patterns (3.10+)

  • use type hints consistently
  • follow PEP 8 and modern Python conventions
  • suggest performance improvements where applicable

Files:

  • garminconnect/__init__.py
🔇 Additional comments (1)
garminconnect/__init__.py (1)

2123-2135: Allowing maxpoly=0 looks correct; add a regression test + verify API behavior.
The switch to _validate_non_negative_integer correctly permits 0 while still rejecting negatives and bool. Please add a small test covering maxpoly=0 and (if possible) confirm the Garmin endpoint accepts maxPolylineSize=0 in practice. Also, the PR description example likely has a typo (maxploy vs maxpoly).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant