Gabriella Lotz has posted comments on this change. ( http://gerrit.cloudera.org:8080/23531 )
Change subject: KUDU-3708 Create Python example for array datatype ...................................................................... Patch Set 1: (6 comments) http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py File examples/python/basic-python-example/array_example.py: http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@30 PS1, Line 30: # Parse arguments : parser = argparse.ArgumentParser(description='Array Data Type Example for Kudu Python.') : parser.add_argument('--masters', '-m', nargs='+', default='localhost', : help='The master address(es) to connect to Kudu.') : parser.add_argument('--ports', '-p', nargs='+', default='7051', : help='The master server port(s) to connect to Kudu.') : args = parser.parse_args() > main() function? Good point! I added modular functions (create_schema(), insert_rows(), scan_rows(), etc.) as requested. I didn't add a main() function to stay consistent with basic_example.py and non_unique_primary_key.py, but happy to add one if you think it's better here. http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@89 PS1, Line 89: try: : session.flush() : except kudu.KuduBadStatus: : print(session.get_pending_errors()) > Why do we prevent this to drop an error? This error handling pattern is copied from basic_example.py and non_unique_primary_key.py, which also catch KuduBadStatus and print errors without stopping execution. I changed it to raise the exception so the script fails fast with a clear error. But this pattern is in the other Python examples too, should I update those as well in a separate patch? http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@124 PS1, Line 124: try: : session.flush() : except kudu.KuduBadStatus: : print(session.get_pending_errors()) > Why do we continue? Done http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@139 PS1, Line 139: op['arr_int64'] = [] # Empty array > nit: Please remove redundant comments like this. You already commented in l Done http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@144 PS1, Line 144: try: : session.flush() : except kudu.KuduBadStatus: : print(session.get_pending_errors()) > Same as above? Done http://gerrit.cloudera.org:8080/#/c/23531/1/examples/python/basic-python-example/array_example.py@162 PS1, Line 162: try: : session.flush() : except kudu.KuduBadStatus: : print(session.get_pending_errors()) > same Done -- To view, visit http://gerrit.cloudera.org:8080/23531 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a84ee9731efdc802673bb964d358b07648b3fae Gerrit-Change-Number: 23531 Gerrit-PatchSet: 1 Gerrit-Owner: Gabriella Lotz <[email protected]> Gerrit-Reviewer: Gabriella Lotz <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Zoltan Martonka <[email protected]> Gerrit-Comment-Date: Wed, 15 Oct 2025 12:33:49 +0000 Gerrit-HasComments: Yes
