Support updateExpire for expire days setting for table#381
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for updating the expire days setting for a table by introducing the updateExpire method across the Java client interface and implementation, along with comprehensive tests.
- Introduces updateExpire in TDClientApi and TDClient
- Adds tests for both successful updates and an error case for non-existent tables
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/test/java/com/treasuredata/client/TestTDClient.java | Added test cases covering updateExpire behavior and error handling |
| src/main/java/com/treasuredata/client/TDClientApi.java | Added updateExpire method signature |
| src/main/java/com/treasuredata/client/TDClient.java | Implemented updateExpire invoking the proper API endpoint |
Comments suppressed due to low confidence (1)
src/main/java/com/treasuredata/client/TDClientApi.java:232
- [nitpick] Consider adding a JavaDoc comment for the updateExpire method to describe its behavior and parameters for consistency with the rest of the API.
void updateExpire(String databaseName, String tableName, int expireDays);
Code ReviewThanks for this PR! The implementation looks clean and well-structured. Here are my findings: ✅ Strengths
📝 Minor SuggestionConsider adding JavaDoc documentation to the /**
* Update the expire days setting for a table
*
* @param databaseName the database name
* @param tableName the table name
* @param expireDays the number of days after which data expires
* @throws TDClientException if the table doesn't exist or other errors occur
*/
void updateExpire(String databaseName, String tableName, int expireDays);✅ TestingThe test implementation is thorough:
Overall, this is a solid PR that cleanly adds the requested functionality. LGTM with the minor documentation suggestion above! 👍 |
- Add updateExpire method to TDClientApi interface - Implement updateExpire method in TDClient class that calls /v3/table/update API - Add comprehensive test for updateExpire functionality including error cases - Method signature matches td-client-ruby and td-client-python implementations Fixes #110 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
ba3f84c to
53c337c
Compare
Summary
updateExpiremethod to Java client to support updating table expire days setting/v3/table/updateAPI endpoint withexpire_daysparameterChanges
updateExpire(String databaseName, String tableName, int expireDays)method toTDClientApiinterfaceTDClientclassTest plan
Fixes #110
🤖 Generated with Claude Code