Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - Don't register connection for local TGIS instances #56

Merged

Conversation

mynhardtburger
Copy link
Contributor

#55 added the TGISBackend.register_model_connection() method.
It however has a bug where if called on a TGISBackend() on a locally managed TGIS instance, it will raise an exception:
It will attempt to create a remote model connection with no config (none provided and no default), resulting in attempting to call .get() on NoneType.

This PR is to fix this bug.

Signed-off-by: Mynhardt Burger <Mynhardt.Burger@ibm.com>
Copy link
Contributor

@gabe-l-hart gabe-l-hart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! One request for a debug log, but the fix is good as is.

@@ -198,6 +200,10 @@ def register_model_connection(
If `fill_with_defaults == True`, missing keys in `conn_cfg` will be populated
with defaults from the TGISBackend's config connection.
"""
# Don't attempt registering a remote model if running local TGIS instance
if self.local_tgis:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's throw a debug log in here at least so there's some visibility

Signed-off-by: Mynhardt Burger <Mynhardt.Burger@ibm.com>
Signed-off-by: Mynhardt Burger <Mynhardt.Burger@ibm.com>
@gabe-l-hart gabe-l-hart merged commit e66e014 into caikit:main Jun 7, 2024
6 checks passed
@mynhardtburger mynhardtburger deleted the bug-fix-register_model_connection branch June 7, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants