Skip to content

APIConnector Typing / Documentation#1857

Open
bmos wants to merge 9 commits into
move-coop:mainfrom
bmos:api_connector
Open

APIConnector Typing / Documentation#1857
bmos wants to merge 9 commits into
move-coop:mainfrom
bmos:api_connector

Conversation

@bmos
Copy link
Copy Markdown
Collaborator

@bmos bmos commented May 3, 2026

What is this change?

  • Improve documentation for APIConnector and OAuth2APIConnector
  • Add type hints for APIConnector and OAuth2APIConnector
  • Call get_request with keyword args within parsons codebase
  • Authenticate APIConnector with HTTPBasicAuth instead of tuple within parsons codebase
  • Implement raise_on_error param for APIConnector.get_request which was documented but not implemented
  • Add raise_on_error param to the other APIConnector *request methods
  • Pass kwargs to requests.request from all APIConnector *request methods for advanced use-cases

Considerations for discussion

  • Because of quirks of python type hint syntax, I had to make most parameters of APIConnector.get_request keyword-only. For consistency, I did this for all the *request methods.

How to test the changes (if needed)

  • CI tests should be adequate.

Breaking Changes

Breaking changes are changes to our public API which may require existing users to change their code. If there are no breaking changes, any existing parsons user should not need to do anything after updating their parsons version.

Does this PR introduce breaking changes?
  • label: Breaking change — This PR introduces one or more breaking changes.
  • label: Non-breaking change — This PR does not introduce one or more breaking changes.

Details (if needed)

  • Switching to keyword-only args could be a breaking change, if users are using APIConnector directly. Do we consider APIConnector a public API? I wasn't sure because, while it is in our documentation, it's described as just being used by other connectors.

@github-actions
Copy link
Copy Markdown

ghost commented May 3, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  parsons/actblue
  actblue.py
  parsons/action_builder
  action_builder.py
  parsons/action_network
  action_network.py 443, 723, 1318, 1529, 2319, 2344
  parsons/capitol_canary
  capitol_canary.py 58-59
  parsons/controlshift
  controlshift.py
  parsons/donorbox
  donorbox.py 114, 149
  parsons/empower
  empower.py
  parsons/formstack
  formstack.py 138, 140
  parsons/freshdesk
  freshdesk.py 50-54
  parsons/mailchimp
  mailchimp.py 403-408
  parsons/mobilecommons
  mobilecommons.py
  parsons/nation_builder
  nation_builder.py
  parsons/newmode
  newmode.py
  parsons/ngpvan
  van_connector.py 80, 89-93
  parsons/quickbase
  quickbase.py
  parsons/quickbooks
  quickbookstime.py
  parsons/rockthevote
  rtv.py 120, 208, 314
  parsons/shopify
  shopify.py
  parsons/sisense
  sisense.py
  parsons/utilities
  api_connector.py 205, 417, 435
  oauth_api_connector.py 139
  parsons/zoom
  zoom.py 105-107, 662, 666-668, 671
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code testing Work type - writing or changing code tests for core Parsons features or Parsons connectors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant