-
Notifications
You must be signed in to change notification settings - Fork 111
[PECOBLR-361] convert column table to arrow if arrow present #551
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
Conversation
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the behavior of fetching query results by converting a ColumnTable to a PyArrow Table when PyArrow is available. It adds a new end-to-end test to validate that the catalogs() API returns a PyArrow Table and updates the fetchall_arrow() method in the client to merge columnar results when appropriate.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/e2e/test_driver.py | Added test_catalogs_returns_arrow_table to verify arrow table conversion. |
src/databricks/sql/client.py | Updated fetchall_arrow() to merge ColumnTables and convert the final result where PyArrow is present. |
can you add more description in the PR to explain why you make this change? Is there any disruption risk of this change? |
Updated description |
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for making the changes
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
* PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed TelemetryHelper Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * [PECOBLR-361] convert column table to arrow if arrow present (#551) Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update CODEOWNERS (#562) new codeowners Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Enhance Cursor close handling and context manager exception management to prevent server side resource leaks (#554) * Enhance Cursor close handling and context manager exception management * tests * fmt * Fix Cursor.close() to properly handle CursorAlreadyClosedError * Remove specific test message from Cursor.close() error handling * Improve error handling in connection and cursor context managers to ensure proper closure during exceptions, including KeyboardInterrupt. Add tests for nested cursor management and verify operation closure on server-side errors. * add * add Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 improve logging on python driver (#556) * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update github actions run conditions (#569) More conditions to run github actions Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed example Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed to doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed self.telemetry close line Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * grouped classes Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * formatting Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added more descriptive comments, put dataclasses in a sub-folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed default attributes ordering Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed file names Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added enums to models folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed telemetry batch size Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> Co-authored-by: Shivam Raj <171748731+shivam2680@users.noreply.github.com> Co-authored-by: Jothi Prakash <jothi.prakash@databricks.com> Co-authored-by: Madhav Sainanee <madhav.sainanee@databricks.com>
* PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed TelemetryHelper Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * [PECOBLR-361] convert column table to arrow if arrow present (#551) Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update CODEOWNERS (#562) new codeowners Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Enhance Cursor close handling and context manager exception management to prevent server side resource leaks (#554) * Enhance Cursor close handling and context manager exception management * tests * fmt * Fix Cursor.close() to properly handle CursorAlreadyClosedError * Remove specific test message from Cursor.close() error handling * Improve error handling in connection and cursor context managers to ensure proper closure during exceptions, including KeyboardInterrupt. Add tests for nested cursor management and verify operation closure on server-side errors. * add * add Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 improve logging on python driver (#556) * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update github actions run conditions (#569) More conditions to run github actions Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed example Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed to doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed self.telemetry close line Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * grouped classes Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * formatting Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added more descriptive comments, put dataclasses in a sub-folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed default attributes ordering Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed file names Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added enums to models folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed telemetry batch size Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> Co-authored-by: Shivam Raj <171748731+shivam2680@users.noreply.github.com> Co-authored-by: Jothi Prakash <jothi.prakash@databricks.com> Co-authored-by: Madhav Sainanee <madhav.sainanee@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
* PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed TelemetryHelper Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * [PECOBLR-361] convert column table to arrow if arrow present (#551) Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update CODEOWNERS (#562) new codeowners Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Enhance Cursor close handling and context manager exception management to prevent server side resource leaks (#554) * Enhance Cursor close handling and context manager exception management * tests * fmt * Fix Cursor.close() to properly handle CursorAlreadyClosedError * Remove specific test message from Cursor.close() error handling * Improve error handling in connection and cursor context managers to ensure proper closure during exceptions, including KeyboardInterrupt. Add tests for nested cursor management and verify operation closure on server-side errors. * add * add Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 improve logging on python driver (#556) * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * PECOBLR-86 Improve logging for debug level Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed format Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed debug to error logs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * used lazy logging Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Update github actions run conditions (#569) More conditions to run github actions Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * Added classes required for telemetry Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed example Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed to doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed self.telemetry close line Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * grouped classes Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * formatting Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed doc string Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added more descriptive comments, put dataclasses in a sub-folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * fixed default attributes ordering Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * changed file names Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added enums to models folder Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed telemetry batch size Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> Co-authored-by: Shivam Raj <171748731+shivam2680@users.noreply.github.com> Co-authored-by: Jothi Prakash <jothi.prakash@databricks.com> Co-authored-by: Madhav Sainanee <madhav.sainanee@databricks.com> Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
What type of PR is this?
Description
Added logic in
fetchall_arrow()
to convertColumnTable
results to apyarrow.Table
ifpyarrow
is installed, maintaining consistency with behavior prior to version 3.5.0. This behavior makes result set aligned with the docstring offetchall_pyarrow
methodHow is this tested?
Introduced a new test case,
test_catalogs_returns_arrow_table
, intests/e2e/test_driver.py
to validate that thefetchall_arrow
method returns apyarrow.Table
when used withcursor.catalogs()
. This test is conditionally executed if Arrow support is available.Related Tickets & Documents
Resolves #550