Skip to content

Commit

Permalink
Avoid creating estimator in stub mode, parse flags passed to the client
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Apr 22, 2024
1 parent 56f18b0 commit f951999
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cpp/flight_sql_example_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ arrow::Status Main() {
}

int main(int argc, char** argv) {
gflags::ParseCommandLineFlags(&argc, &argv, /*remove_flags=*/true);
auto status = Main();
if (!status.ok()) {
std::cerr << status.ToString() << std::endl;
Expand Down
5 changes: 3 additions & 2 deletions src/brad/front_end/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def txn_start_timestamp(self) -> datetime:
async def close(self):
self._closed = True
await self._engines.close()
await self._estimator.close()
if self._estimator is not None:
await self._estimator.close()


class SessionManager:
Expand Down Expand Up @@ -116,7 +117,7 @@ async def create_new_session(self) -> Tuple[SessionId, Session]:
routing_policy_override == RoutingPolicy.ForestTableSelectivity
or routing_policy_override == RoutingPolicy.Default
):
if self._config.stub_mode_path() is not None:
if self._config.stub_mode_path() is None:
estimator: Optional[Estimator] = await PostgresEstimator.connect(
self._schema_name, self._config
)
Expand Down

0 comments on commit f951999

Please sign in to comment.