Skip to content

fix(http): coerce exclude_ended to int for yarl - #1828

Open
thrashxr wants to merge 1 commit into
interactions-py:stablefrom
thrashxr:fix-entitlements-exclude-ended
Open

thrashxr wants to merge 1 commit into
interactions-py:stablefrom
thrashxr:fix-entitlements-exclude-ended

Conversation

@thrashxr

Copy link
Copy Markdown

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

fetch_entitlements(exclude_ended=True) passes a Python bool into yarl query params and raises TypeError. Coerce exclude_ended with int(...) when it is not None, matching how other Discord query bools are handled in this codebase.

Changes

  • In EntitlementRequests.get_entitlements, send exclude_ended as 0/1 instead of a raw bool

Related Issues

Fixes #1827

Test Scenarios

  • Call get_entitlements with exclude_ended=True / False and confirm the request query uses 1 / 0 (yarl accepts the values; a raw bool still raises TypeError)
  • No Discord token required for that check

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

This branch has not been deployed

No deployments
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.

[BUG] Client fetch_entitlements fails when exclude_ended is a boolean

1 participant