Skip to content

fix: make DataMapInfo.description and NotificationSetting.resource_id optional (NEX-20648)#13

Merged
saksham-nexla merged 1 commit intomainfrom
devin/1770734656-fix-optional-fields
Feb 10, 2026
Merged

fix: make DataMapInfo.description and NotificationSetting.resource_id optional (NEX-20648)#13
saksham-nexla merged 1 commit intomainfrom
devin/1770734656-fix-optional-fields

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

fix: make DataMapInfo.description and NotificationSetting.resource_id optional (NEX-20648)

Summary

Two Pydantic model fields in nexla-sdk were incorrectly marked as required, but the underlying database columns are nullable (DEFAULT NULL) and the admin-api can return null for them. This causes ValidationError when the SDK parses API responses — specifically when veda-ai MCP tools call destinations.list() or notification settings endpoints.

Changes (2 one-line model fixes + 4 unit tests):

  • DataMapInfo.description: strOptional[str] = None
  • NotificationSetting.resource_id: intOptional[int] = None

These are non-breaking changes (strictly more permissive validation).

Review & Testing Checklist for Human

  • Search SDK codebase for any code that assumes DataMapInfo.description or NotificationSetting.resource_id are non-None (e.g., string operations on .description, arithmetic on .resource_id). Making these Optional at the Pydantic layer doesn't guarantee downstream consumers handle None correctly.
  • Verify the notification error path: The reported MCP error says "for Notification resource_id" but Notification.resource_id is already Optional. This fix targets NotificationSetting.resource_id instead. Confirm the actual failing call path hits NotificationSetting (e.g., via list_settings()), since list_nexla_notifications in the MCP ALLOWED_METHODS maps to notifications.list() which uses the Notification model.
  • End-to-end test: Unit tests use mocked responses. Manually test with a real Nexla API account that has destinations with null data_map.description and/or notification settings with null resource_id to confirm the fix resolves the original MCP tool failures.

Notes

  • Confirmed via admin-api/db/structure.sql: data_maps.description varchar(255) DEFAULT NULL and notification_settings.resource_id int DEFAULT NULL
  • No changes needed in veda-ai — it will work automatically once the SDK is updated
  • Link to Devin run
  • Requested by: @ag-nexla

… optional

The Nexla API can return None for data_maps.description and
notification_settings.resource_id (both columns are DEFAULT NULL in the
database). The SDK Pydantic models incorrectly marked these as required,
causing validation errors when MCP tools in veda-ai called
destinations.list() or notification settings endpoints.

- DataMapInfo.description: str -> Optional[str] = None
- NotificationSetting.resource_id: int -> Optional[int] = None
- Added unit tests for None-value validation scenarios

NEX-20648

Co-Authored-By: anubhav.ghildiyal@nexla.com <anubhav.ghildiyal@nexla.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 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

@saksham-nexla saksham-nexla merged commit 95a979b into main Feb 10, 2026
6 of 7 checks passed
saksham-nexla added a commit that referenced this pull request Mar 22, 2026
Merges 3 PRs from main:
- #13: Make DataMapInfo.description and NotificationSetting.resource_id optional
- #14: Add monitoring endpoint methods with explicit params for MCP integration
- #15: Add copy_and_replace_credentials convenience method to FlowsResource

Resolved conflicts in base_resource.py, metrics.py, organizations.py,
and users.py by keeping branch's additional methods while incorporating
main's enhanced audit_log params and new monitoring methods.
saksham-nexla added a commit that referenced this pull request Mar 22, 2026
Add 36 new tests (29 Python, 7 TypeScript) covering methods from
merged PRs #13, #14, #15 and their TS SDK mirrors:

Python:
- base_resource get_audit_log filter/pagination params (6 tests)
- metrics publish_raw, resource_flow_metrics, flow_metrics_summary (4)
- organizations audit_log explicit params, flow_status_metrics (5)
- users audit_log params, account_metrics aggregate, flow_status_metrics (6)
- flows get_flow_logs, search_flow_logs, active_flows_metrics, run_status (8)

TypeScript:
- flows copy_and_replace_credentials edge cases (3)
- organizations/users audit_log query params and empty responses (4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant