Copilot commented on code in PR #4539:
URL: https://github.com/apache/arrow-adbc/pull/4539#discussion_r3647958871
##########
java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/FlightSqlDriver.java:
##########
@@ -47,14 +63,8 @@ public AdbcDatabase open(Map<String, Object> parameters)
throws AdbcException {
uri = (String) target;
}
- Location location;
- try {
- location = new Location(uri);
- } catch (URISyntaxException e) {
- throw AdbcException.invalidArgument(
- String.format("[Flight SQL] Location %s is invalid: %s", uri, e))
- .withCause(e);
- }
+ Location location = parseLocation(uri);
Review Comment:
PR description says `FlightSqlDatabase#toString` now includes the originally
configured URI alongside the resolved target, but
`FlightSqlDatabase.toString()` still only prints the resolved `Location` target
(see `FlightSqlDatabase.java:82-84`). Either update the implementation to
retain/report the original URI (e.g., store `uri` in `FlightSqlDatabase`) or
adjust the PR description to match the actual change set.
##########
java/driver/flight-sql/src/test/java/org/apache/arrow/adbc/driver/flightsql/TlsTest.java:
##########
@@ -170,10 +170,37 @@ public void testClientTlsOnGoodHostnameOverride() throws
Exception {
}
}
+ @Test
+ public void testClientFlightSqlSchemeDefaultTls() throws Exception {
+ params.put(AdbcDriver.PARAM_URI.getKey(), getFlightSqlUri(null));
+ params.put(FlightSqlConnectionProperties.TLS_SKIP_VERIFY.getKey(), true);
+ AdbcDatabase db =
+ AdbcDriverManager.getInstance()
+ .connect(FlightSqlDriverFactory.class.getCanonicalName(),
allocator, params);
+ try (AdbcConnection conn = db.connect()) {}
+ }
Review Comment:
`AdbcDatabase` implements `AutoCloseable` but is not closed here. Wrapping
it in try-with-resources prevents resource leaks and keeps these tests
consistent with other tests (e.g., `FlightSqlDriverUriTest` closes its
`AdbcDatabase`).
This issue also appears on line 183 of the same file.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]