yu-iskw commented on PR #3174:
URL: https://github.com/apache/arrow-adbc/pull/3174#issuecomment-3096427119

   ## Summary
   
   This PR improves the BigQuery driver's impersonation lifetime handling by:
   
   1. **Type Safety**: Changed `impersonateLifetime` from `string` to 
`time.Duration` in both `databaseImpl` and `connectionImpl` structs
   2. **Validation**: Added proper duration parsing with error handling in 
`SetOption` methods
   3. **Default Behavior**: Implemented consistent default lifetime (1 hour) 
when impersonation is enabled but no lifetime is specified
   4. **GetOption Support**: Added `WithImpersonateLifetime` case to return the 
current lifetime value
   5. **Helper Method**: Added `hasImpersonationOptions()` method to check if 
impersonation is configured
   6. **Code Cleanup**: Removed unused `WithAccessToken` constant and 
simplified lifetime handling logic
   
   ## Key Changes
   
   - **Type Conversion**: `impersonateLifetime string` → `impersonateLifetime 
time.Duration`
   - **Error Handling**: Added `time.ParseDuration()` with proper error messages
   - **Default Values**: Returns "1h" when impersonation is enabled but no 
lifetime set
   - **Simplified Logic**: Removed redundant duration parsing in `newClient()` 
method
   - **Consistent API**: Both database and connection now handle lifetime 
options identically
   
   The changes ensure better type safety, consistent error handling, and more 
predictable default behavior for impersonation lifetime configuration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to