Skip to content

fix: initialize missing address attribute in HanaHandler#12328

Merged
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
Krishnachaitanyakc:fix/hana-handler-missing-address-attribute
Mar 30, 2026
Merged

fix: initialize missing address attribute in HanaHandler#12328
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
Krishnachaitanyakc:fix/hana-handler-missing-address-attribute

Conversation

@Krishnachaitanyakc

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the AttributeError: 'HanaHandler' object has no attribute 'address' that occurs when SAP HANA queries fail. The native_query method references self.address in error logging, but self.address was never initialized in __init__, causing the AttributeError to mask the actual database error.
  • Fixes a copy-paste typo in the connect method where the error message incorrectly referenced "Teradata" instead of "SAP HANA".

Closes #12132

Changes

  • Added self.address = self.connection_data.get('address') in HanaHandler.__init__() so that self.address is available when referenced in native_query error handlers.
  • Corrected the logger message in connect() from "Teradata" to "SAP HANA".

Test plan

  • Verify that when a SAP HANA query fails with a ProgrammingError, the original database error message is correctly logged and returned (instead of AttributeError).
  • Verify that self.address is populated from connection_data['address'] upon handler initialization.
  • Verify that the error message in connect() now correctly references "SAP HANA" instead of "Teradata".

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 StpMax changed the base branch from main to releases/26.1.0 March 30, 2026 12:52
@github-actions

github-actions Bot commented Mar 30, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Krishnachaitanyakc

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Mar 30, 2026
@StpMax StpMax merged commit c675b5b into mindsdb:releases/26.1.0 Mar 30, 2026
11 of 14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AttributeError: 'HanaHandler' object has no attribute 'address'

2 participants