Conversation
…is between NocoDB v2 and v3 - Implement `analyze_api_diff.py` to compare endpoints, parameters, request/response schemas, and generate a markdown report summarizing the differences. - Implement `analyze_schemas.py` to analyze request/response schemas and query parameters, generating a detailed report on schema changes and observations.
- Updated methods in NocoDBMetaClient to dynamically construct API endpoints based on the API version. - Added support for base_id in various methods to accommodate API v3 requirements. - Modified test cases to ensure compatibility with the new API versioning and endpoint structure. - Adjusted mock setups in tests to reflect changes in API version handling.
…ding automatic parameter conversion and backward compatibility
…and resolver classes
🔍 PR Validation ReportOverall Status: ❌ FAILED Validation Results
Automated validation by Automation Templates |
There was a problem hiding this comment.
Pull Request Overview
This PR implements seamless support for NocoDB API v2 and v3 with automatic parameter conversion and backward compatibility. The implementation provides a transparent upgrade path from v2 to v3 without breaking existing code.
Key Changes:
- Added API version support with automatic parameter conversion (pagination, sorting, operators)
- Implemented BaseIdResolver with caching for v3 API base_id resolution
- Extended all Data API and Meta API methods to support both v2 and v3
- Added comprehensive documentation and examples for API version migration
Reviewed Changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/nocodb_simple_client/api_version.py |
Core API version support with PathBuilder and QueryParamAdapter |
src/nocodb_simple_client/base_resolver.py |
BaseIdResolver for v3 API base_id resolution and caching |
src/nocodb_simple_client/client.py |
Extended NocoDBClient with v2/v3 support and parameter conversion |
src/nocodb_simple_client/meta_client.py |
Updated Meta API client with full v2/v3 compatibility |
src/nocodb_simple_client/table.py |
Added base_id parameter support to NocoDBTable wrapper |
tests/test_version_switching.py |
Integration tests for API version switching functionality |
tests/test_api_version.py |
Unit tests for PathBuilder and QueryParamAdapter components |
tests/test_base_resolver.py |
Comprehensive tests for BaseIdResolver caching and resolution |
examples/api_version_example.py |
Data API usage examples for both v2 and v3 |
examples/meta_api_version_example.py |
Meta API usage examples demonstrating version differences |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| mock_client.get_records.assert_called_once_with( | ||
| "test_table_123", None, "(Status,eq,active)", None, 10 | ||
| "test_table_123", base_id=None, sort=None, where="(Status,eq,active)", fields=None, limit=10 | ||
| ) |
There was a problem hiding this comment.
[nitpick] The test assertion uses keyword arguments in a specific order. Consider using a more flexible approach with **kwargs or dict comparison to make the test less brittle to parameter order changes.
| return self.client.get_records( | ||
| self.table_id, base_id=base_id, sort=sort, where=where, fields=fields, limit=limit | ||
| ) |
There was a problem hiding this comment.
Method signature maintains backward compatibility by adding base_id as an optional parameter. The implementation correctly passes all parameters using keyword arguments for clarity.
Unreleased
Features
api_versionparameter for client initialization (default: "v2")offset/limit(v2) ↔page/pageSize(v3)ne→neq)BaseIdResolverwith caching for v3 API base_id resolutionNocoDBTablewrapper to supportbase_idparameterDocumentation
Tests
base_idparameter