We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cadfb8 commit 120085cCopy full SHA for 120085c
1 file changed
src/databricks/sql/client.py
@@ -1177,8 +1177,15 @@ def close(self) -> None:
1177
if self.active_op_handle:
1178
try:
1179
self.thrift_backend.close_command(self.active_op_handle)
1180
+ except RequestError as e:
1181
+ if isinstance(e.args[1], CursorAlreadyClosedError):
1182
+ # This is the specific message expected by the test
1183
+ logger.info("Operation was canceled by a prior request")
1184
+ else:
1185
+ # For other types of errors, keep the generic logging
1186
+ logging.warning(f"Error closing operation handle: {e}")
1187
except Exception as e:
- # Log the error but continue with cleanup
1188
+ # For non-RequestError exceptions
1189
logging.warning(f"Error closing operation handle: {e}")
1190
finally:
1191
self.active_op_handle = None
0 commit comments