fix: make DataMapInfo.description and NotificationSetting.resource_id optional (NEX-20648)#13
Merged
saksham-nexla merged 1 commit intomainfrom Feb 10, 2026
Conversation
… 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>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
saksham-nexla
approved these changes
Feb 10, 2026
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 returnnullfor them. This causesValidationErrorwhen the SDK parses API responses — specifically when veda-ai MCP tools calldestinations.list()or notification settings endpoints.Changes (2 one-line model fixes + 4 unit tests):
DataMapInfo.description:str→Optional[str] = NoneNotificationSetting.resource_id:int→Optional[int] = NoneThese are non-breaking changes (strictly more permissive validation).
Review & Testing Checklist for Human
DataMapInfo.descriptionorNotificationSetting.resource_idare non-None (e.g., string operations on.description, arithmetic on.resource_id). Making these Optional at the Pydantic layer doesn't guarantee downstream consumers handleNonecorrectly.Notification.resource_idis already Optional. This fix targetsNotificationSetting.resource_idinstead. Confirm the actual failing call path hitsNotificationSetting(e.g., vialist_settings()), sincelist_nexla_notificationsin the MCP ALLOWED_METHODS maps tonotifications.list()which uses theNotificationmodel.data_map.descriptionand/or notification settings with nullresource_idto confirm the fix resolves the original MCP tool failures.Notes
admin-api/db/structure.sql:data_maps.description varchar(255) DEFAULT NULLandnotification_settings.resource_id int DEFAULT NULL