fix: initialize missing address attribute in HanaHandler#12328
Merged
StpMax merged 1 commit intoMar 30, 2026
Merged
Conversation
The HanaHandler's native_query method references self.address in error logging (lines 166 and 174), but self.address was never initialized in __init__, causing an AttributeError when database queries fail. This masked the actual database error, making debugging difficult. Also fix a copy-paste error in the connect method where the error message incorrectly referenced "Teradata" instead of "SAP HANA". Fixes mindsdb#12132
StpMax
approved these changes
Mar 30, 2026
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AttributeError: 'HanaHandler' object has no attribute 'address'that occurs when SAP HANA queries fail. Thenative_querymethod referencesself.addressin error logging, butself.addresswas never initialized in__init__, causing the AttributeError to mask the actual database error.connectmethod where the error message incorrectly referenced "Teradata" instead of "SAP HANA".Closes #12132
Changes
self.address = self.connection_data.get('address')inHanaHandler.__init__()so thatself.addressis available when referenced innative_queryerror handlers.connect()from "Teradata" to "SAP HANA".Test plan
ProgrammingError, the original database error message is correctly logged and returned (instead ofAttributeError).self.addressis populated fromconnection_data['address']upon handler initialization.connect()now correctly references "SAP HANA" instead of "Teradata".