Skip to content

Conversation

@tjb9dc
Copy link
Collaborator

@tjb9dc tjb9dc commented Nov 25, 2025

Description

Refs: Slack thread from @tjb9dc

Updates the Python wire test generator to format datetime values using datetime.fromisoformat() instead of passing them as plain strings.

Before: datetime="2024-07-01T15:30:00+00:00"
After: datetime=datetime.datetime.fromisoformat("2024-07-01T15:30:00+00:00")

Changes Made

  • Added import datetime to generated wire test files
  • Added getPrimitiveType() helper to unwrap optional/nullable types and extract the underlying primitive type
  • Modified formatValue() and jsonToPython() to accept type reference information
  • When type is DATE_TIME, formats as datetime.datetime.fromisoformat("...")
  • When type is DATE, formats as datetime.date.fromisoformat("...")
  • Updated buildPathParameters, buildQueryParameters, buildHeaders, and buildRequestBody to pass type information from the dynamic IR

Testing

  • TypeScript compilation passes
  • Lint checks pass
  • Seed tests with datetime fixtures (not run locally - CI will validate)

Human Review Checklist

  • Verify type reference lookup logic correctly maps parameter names to their types
  • Check handling of nested datetime values in objects (currently type info not propagated to nested object values)
  • Confirm generated Python code is syntactically correct for datetime/date types

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

@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

@tjb9dc
Copy link
Collaborator Author

tjb9dc commented Nov 26, 2025

Not necessary now that we are using dynamic snippets

@tjb9dc tjb9dc closed this Nov 26, 2025
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