feat(generated): Add Pipes operations and models#685
Conversation
Greptile SummaryThis PR adds generated Pipes data integration support. The main changes are:
Confidence Score: 4/5The generated Pipes surface is mostly complete, but the update helper needs attention before merge because it prevents callers from sending an explicit null reset. The review focused on the new resource methods, generated request models, exports, and tests, and the main correctness issue is isolated to request body filtering for update calls. src/workos/pipes/_resource.py
What T-Rex did
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/workos/pipes/_resource.py:203-217
**Preserve null updates**
`update_data_integration(scopes=None)` cannot perform the documented reset because this body comprehension drops every `None` value before the request is sent. The generated `UpdateDataIntegration.to_dict()` preserves `scopes: None` for this operation, so callers using the resource method can only omit `scopes`, not reset it; the async implementation below has the same body filtering.
Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile |
| body: Dict[str, Any] = { | ||
| k: v | ||
| for k, v in { | ||
| "description": description, | ||
| "enabled": enabled, | ||
| "scopes": scopes, | ||
| "credentials": credentials.to_dict() | ||
| if credentials is not None | ||
| else None, | ||
| "custom_provider": custom_provider.to_dict() | ||
| if custom_provider is not None | ||
| else None, | ||
| }.items() | ||
| if v is not None | ||
| } |
There was a problem hiding this comment.
Preserve null updates
update_data_integration(scopes=None) cannot perform the documented reset because this body comprehension drops every None value before the request is sent. The generated UpdateDataIntegration.to_dict() preserves scopes: None for this operation, so callers using the resource method can only omit scopes, not reset it; the async implementation below has the same body filtering.
Artifacts
Repro: focused pytest covering sync and async scopes=None request serialization
- Contains supporting evidence from the run (text/x-python; charset=utf-8).
Repro: verbose pytest output showing HTTP 200 mock responses and omitted scopes request bodies
- Keeps the command output available without making the summary code-heavy.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/pipes/_resource.py
Line: 203-217
Comment:
**Preserve null updates**
`update_data_integration(scopes=None)` cannot perform the documented reset because this body comprehension drops every `None` value before the request is sent. The generated `UpdateDataIntegration.to_dict()` preserves `scopes: None` for this operation, so callers using the resource method can only omit `scopes`, not reset it; the async implementation below has the same body filtering.
How can I resolve this? If you propose a fix, please make it concise.
Summary
feat(pipes): Add Pipes operations and models
DataIntegrationCredentialsDto.CustomProviderDefinition.CreateDataIntegration.UpdateCustomProviderDefinition.UpdateDataIntegration.DataIntegration.DataIntegrationList.DataIntegrationListListMetadata.DataIntegrationCredential.DataIntegrationCustomProvider.DataIntegrationCredentialsType.CustomProviderDefinitionAuthenticateVia.UpdateCustomProviderDefinitionAuthenticateVia.DataIntegrationState.DataIntegrationCredentialType.DataIntegrationCustomProviderAuthenticateVia.GET /data-integrations.POST /data-integrations.GET /data-integrations/{slug}.PUT /data-integrations/{slug}.DELETE /data-integrations/{slug}.POST /user_management/users/{user_id}/connected_accounts/{slug}.PUT /user_management/users/{user_id}/connected_accounts/{slug}.Triggered by workos/openapi-spec@e350eb0
BEGIN_COMMIT_OVERRIDE
feat(pipes): Add Pipes operations and models (#685)
END_COMMIT_OVERRIDE