Copilot commented on code in PR #7161: URL: https://github.com/apache/hbase/pull/7161#discussion_r2211858091
########## hbase-examples/src/main/python/thrift1/DemoClient.py: ########## @@ -187,15 +187,15 @@ def demo_client(host, port, is_framed_transport): r = client.get(t, row, "entry:foo", dummy_attributes) # just to be explicit, we get lists back, if it's empty there was no matching row. if len(r) > 0: - raise "shouldn't get here!" + raise Exception("shouldn't get here!") Review Comment: [nitpick] Using a generic Exception is less specific than the original string raise. Consider using a more specific exception type like RuntimeError or AssertionError for better error handling. ```suggestion raise AssertionError("shouldn't get here!") ``` ########## hbase-examples/src/main/python/thrift1/demo_hbase_thrift_over_http_tls.py: ########## @@ -37,35 +37,35 @@ from hbase.ttypes import Mutation from hbase.ttypes import IOError as HBaseIOError -print "[INFO] setup connection" -transport = THttpClient.THttpClient("https://{0}:{1}".format(sys.argv[1], 9090)) +print("[INFO] setup connection") +transport = THttpClient.THttpClient(f"https://{sys.argv[1]}:9090") Review Comment: The f-string hardcodes port 9090, but the original code used a parameter. This creates an inconsistency and reduces maintainability. Consider using f"https://{sys.argv[1]}:{9090}" or defining the port as a variable. ```suggestion PORT = 9090 transport = THttpClient.THttpClient(f"https://{sys.argv[1]}:{PORT}") ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org