fix: resolve Sentry validation errors causing 177+ production failures#10
Merged
saksham-nexla merged 11 commits intomainfrom Jan 31, 2026
Merged
fix: resolve Sentry validation errors causing 177+ production failures#10saksham-nexla merged 11 commits intomainfrom
saksham-nexla merged 11 commits intomainfrom
Conversation
…mports - Removed CustodianUser from the imports and __all__ definitions in marketplace-related modules to streamline the model structure. - Updated relevant files to reflect these changes, enhancing code clarity and maintainability.
Add comprehensive skill documentation and helper scripts for Nexla SDK: - SKILL.md: skill definition and capabilities reference - EXAMPLES.md: recipes and usage patterns for common workflows - REFERENCE.md: detailed API reference and configuration guide - scripts/: utility scripts for resource management, health checks, and operations - nexla_quickstart.py: quick sanity check for auth and listings - list_resources.py: list and filter resources by type and name - deploy_flow.py: deploy flows from configuration files - get_resource_logs.py: fetch logs for resources - health_check.py: validate system health and connectivity - batch_operations.py: batch create/update operations - circuit_breaker.py: circuit breaker pattern for resilience - retry_helpers.py: exponential backoff and retry utilities
- Add webhooks resource with models for webhook management - Enhance flows resource with additional API methods - Expand skill documentation with ACCESS_CONTROL.md and TRANSFORMS.md - Update EXAMPLES.md and REFERENCE.md with comprehensive guides - Add manage_access.py utility script for access control operations
Resolved conflicts in: - nexla_sdk/client.py: Keep webhooks import and create_webhook_client method - nexla_sdk/models/__init__.py: Keep webhook models in exports - nexla_sdk/resources/flows.py: Keep enhanced docstrings and typed return values
- Create tests/unit/test_webhooks.py with 18 tests covering WebhooksResource - Model validation tests for WebhookSendOptions and WebhookResponse - Core functionality tests for send_one_record and send_many_records - Authentication tests for query and header auth methods - Error handling tests for network failures - HTTP client lazy creation tests - Rewrite tests/unit/test_flows.py to fix tests that were never running - Add pytestmark = pytest.mark.unit (was missing, causing 0 tests selected) - Switch from MagicMock to MockHTTPClient.add_response pattern - Use access_token auth to avoid double HTTP calls from token fetch - Add model validation tests (FlowLogsResponse, FlowMetricsApiResponse, etc.) - Add tests for new methods: docs_recommendation, get_logs, get_metrics - Add tests for new parameters: access_role, async_mode - Update tests/test_client_init.py with create_webhook_client tests - Update tests/utils/mock_builders.py with new response builders
- Use shared mock_client fixture instead of local fixtures - Replace MagicMock with add_response/assert_request_made pattern - Make assertion helpers more flexible with optional field checks - Reduce code duplication across test files
Pytest 9 deprecates applying marks to fixtures. The integration_client fixture already handles skipping internally via pytest.skip() calls.
…low models This commit fixes 4 production issues identified in Sentry that were causing 177+ validation errors: - EXPRESS-1K (91 events): DestinationType enum missing 'supabase' - EXPRESS-1J (58 events): DataSinkSimplified missing Optional fields + enum - EXPRESS-2A (22 events): Notification.resource_id should be Optional - EXPRESS-27 (6 events): FlowsResource.get() missing include_run_metrics param Changes: - Add 27 missing connector types to DestinationType enum including supabase - Make DataSinkSimplified.owner_id and org_id Optional - Make Notification.resource_id Optional - Add include_run_metrics parameter to FlowsResource.get()
ameyitis
approved these changes
Jan 31, 2026
Resolved conflict in nexla_sdk/resources/flows.py by keeping the current branch's formatting style (double quotes, consistent line breaks).
- Standardize import ordering and grouping - Apply consistent quote style (double quotes) - Add trailing commas for better diffs - Fix whitespace and line breaks - Clean up docstring formatting
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.
Summary
This PR fixes 4 production issues identified in Sentry (organization:
nexla-z4) that were causing 177+ validation errors in production. The root causes were incomplete enum definitions, overly strict field requirements, and a missing API method parameter.Sentry Issues Fixed
1. EXPRESS-1K - DestinationType enum missing connector types
ValidationError: 1 validation error for Nexset - data_sinks.0.sink_type: Input should be 's3', 'gcs', ... or 'pinecone' [type=enum, input_value='supabase', input_type=str]nexla_sdk/resources/base_resource.py:103in_parse_response()Root Cause: The
DestinationTypeenum was incomplete and missingsupabaseand 25+ other connector types that the API can return.Fix: Added 27 missing connector types to
DestinationTypeenum innexla_sdk/models/destinations/enums.py:SUPABASE,AZURE_DATA_LAKE,MIN_IO_S3,WEBDAVORACLE_AUTONOMOUS,SNOWFLAKE_DCR,AS400,AWS_ATHENA,AZURE_SYNAPSECLOUDSQL_MYSQL,CLOUDSQL_POSTGRES,CLOUDSQL_SQLSERVER,DB2,FIREBOLTGCP_ALLOYDB,GCP_SPANNER,HANA_JDBC,HIVE,NETSUITE_JDBC,SYBASE,TERADATADELTA_LAKE_AZURE_BLB,DELTA_LAKE_AZURE_DATA_LAKE,DELTA_LAKE_S3,S3_ICEBERGJMS,TIBCO,SOAP,NEXLA_MONITOR2. EXPRESS-1J - DataSinkSimplified required fields should be Optional
ValidationError: 3 validation errors for Nexset - data_sinks.0.owner_id: Field required, data_sinks.0.org_id: Field required, data_sinks.0.sink_type: enum errornexla_sdk/resources/nexsets.py:47inget()Root Cause: The
DataSinkSimplifiedmodel hadowner_idandorg_iddefined as requiredintfields, but the API sometimes returns data sinks without these fields.Fix: Changed
owner_idandorg_idfrominttoOptional[int] = Noneinnexla_sdk/models/nexsets/responses.py.3. EXPRESS-2A - Notification.resource_id should be Optional
ValidationError: 1 validation error for Notification - resource_id: Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]nexla_sdk/resources/notifications.py:80inlist()Root Cause: The
Notificationmodel hadresource_iddefined as requiredint, but the API can returnnullfor this field.Fix: Changed
resource_idfrominttoOptional[int] = Noneinnexla_sdk/models/notifications/responses.py.4. EXPRESS-27 - FlowsResource.get() missing include_run_metrics parameter
TypeError: FlowsResource.get() got an unexpected keyword argument 'include_run_metrics'nexla_sdk/resources/flows.pyinget()Root Cause: The
FlowsResource.get()method only acceptedflow_idandflows_onlyparameters, but callers expectedinclude_run_metricsto be supported (which was already supported bylist()).Fix: Added
include_run_metrics: bool = Falseparameter toFlowsResource.get()innexla_sdk/resources/flows.py.Files Changed
nexla_sdk/models/destinations/enums.pyDestinationTypeenumnexla_sdk/models/nexsets/responses.pyowner_idandorg_idOptional inDataSinkSimplifiednexla_sdk/models/notifications/responses.pyresource_idOptional inNotificationnexla_sdk/resources/flows.pyinclude_run_metricsparameter toget()Test Plan
Impact
This fix will resolve 177+ production validation errors currently occurring in the Sentry dashboard.