feat!: return full FetchResponse from context.fetch()#20
feat!: return full FetchResponse from context.fetch()#20TheRealAgentK wants to merge 4 commits intomasterfrom
Conversation
Add FetchResponse dataclass (status, headers, data) and update ExecutionContext.fetch() to return it instead of the raw parsed body. Export FetchResponse from the package.
Update all code examples, docstrings, and prose to use response.data instead of the raw response body, reflecting the new FetchResponse return type from context.fetch().
Add 43 missing production files and 13 test files to the autohive-integrations audit list.
Hamish-taylor
left a comment
There was a problem hiding this comment.
Just one comment about the plan file. But I am happy with the code
There was a problem hiding this comment.
Does this plan file belong in this repo? 🤔
There was a problem hiding this comment.
That's a fair question, but I think it's useful - I'm a big fan of information in the repo and given that - while 12 is completed in here - there's follow-up work I want to audit against at some point when this change goes into a release, I think it's a good place. Happy to remove in the future.
The other options are to put it into a discussion thread, a new GH issue or in our internal Notion, but none of those are ideal either.
|
Please don't merge for the time being - waiting for the Action Error PR (#19) to be merged first. |
Summary
Closes #12.
context.fetch()now returns aFetchResponsedataclass instead of the raw parsed body, giving callers access to HTTP status codes and response headers.Changes
Implementation
FetchResponsedataclass withstatus,headers, anddatafieldsExecutionContext.fetch()to returnFetchResponse(return type + body)FetchResponsefrom__init__.pyDocs & samples
billing.md,building_your_first_integration.md,connected_account.md,integration_structure.md,patterns.md)api-fetch,template)integration.pyMigration plan
docs/plans/12.mdwith a full audit of all downstream repos that need updating (4 repos, ~100 Python files, 3 markdown files)Breaking change
Callers must now use
response.datato access the parsed body:See
docs/plans/12.mdfor the full rollout plan acrossautohive-integrations,integrations,Autohive, andautohive-docs.