Skip to content

Conversation

@tjb9dc
Copy link
Collaborator

@tjb9dc tjb9dc commented Jan 8, 2026

Description

Fixes wire test generation to filter out nop() values when generating method arguments. This prevents invalid Python syntax like param= without a value when an example contains an invalid enum value or undefined property.

Link to Devin run: https://app.devin.ai/sessions/9a00a050c1fd43e1952afc9673406aca
Requested by: @tjb9dc

Changes Made

  • Added .filter((arg) => !python.TypeInstantiation.isNop(arg.value)) in EndpointSnippetGenerator.ts to filter out nop values before creating method arguments
  • Updated versions.yml with changelog entry for version 4.46.9

Root Cause

When a property value is converted to nop() (e.g., because it's an invalid enum value or an undefined property in the schema), the nop() value was still being included in method arguments, generating param= without a value and causing a Python syntax error.

This was discovered in the Twilio API where Status: status was used as a placeholder instead of a valid enum value.

Testing

  • Lint checks pass (pnpm check)
  • Seed testing skipped per user request

Human Review Checklist

  • ⚠️ IMPORTANT: Verify only EndpointSnippetGenerator.ts and versions.yml are changed - user requested removal of all fixture/seed test changes, but the diff may still contain exhaustive fixture modifications that should not be included
  • Verify the filter logic won't accidentally filter legitimate values (only nop() should be filtered)
  • Confirm PR title scope is python (not python-sdk) to pass lint checks

devin-ai-integration bot and others added 3 commits January 8, 2026 02:18
Co-Authored-By: thomas@buildwithfern.com <tjb9dcshop@gmail.com>
Co-Authored-By: thomas@buildwithfern.com <tjb9dcshop@gmail.com>
Co-Authored-By: thomas@buildwithfern.com <tjb9dcshop@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@fern-support fern-support changed the title fix(python-sdk): filter out nop values when generating method arguments fix(python): filter out nop values when generating method arguments Jan 8, 2026
@devin-ai-integration devin-ai-integration bot changed the title fix(python): filter out nop values when generating method arguments fix(python): filter out nop values when generating wire test method arguments Jan 8, 2026
Co-Authored-By: thomas@buildwithfern.com <tjb9dcshop@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title fix(python): filter out nop values when generating wire test method arguments fix(python-sdk): filter out nop values when generating wire test method arguments Jan 8, 2026
@devin-ai-integration devin-ai-integration bot changed the title fix(python-sdk): filter out nop values when generating wire test method arguments fix(python): filter out nop values when generating wire test method arguments Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants