Skip to content

SEA: Execution Phase #645

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

Open
wants to merge 86 commits into
base: main
Choose a base branch
from
Open

SEA: Execution Phase #645

wants to merge 86 commits into from

Conversation

varun-edachali-dbx and others added 30 commits May 28, 2025 17:51
* decouple session class from existing Connection

ensure maintenance of current APIs of Connection while delegating
responsibility

Signed-off-by: varun-edachali-dbx <[email protected]>

* add open property to Connection to ensure maintenance of existing API

Signed-off-by: varun-edachali-dbx <[email protected]>

* update unit tests to address ThriftBackend through session instead of through Connection

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: move session specific tests from test_client to test_session

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

as in CONTRIBUTING.md

Signed-off-by: varun-edachali-dbx <[email protected]>

* use connection open property instead of long chain through session

Signed-off-by: varun-edachali-dbx <[email protected]>

* trigger integration workflow

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: ensure open attribute of Connection never fails

in case the openSession takes long, the initialisation of the session
will not complete immediately. This could make the session attribute
inaccessible. If the Connection is deleted in this time, the open()
check will throw because the session attribute does not exist. Thus, we
default to the Connection being closed in this case. This was not an
issue before because open was a direct attribute of the Connection
class. Caught in the integration tests.

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: de-complicate earlier connection open logic

earlier, one of the integration tests was failing because 'session was
not an attribute of Connection'. This is likely tied to a local
configuration issue related to unittest that was causing an error in the
test suite itself. The tests are now passing without checking for the
session attribute.
c676f9b

Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "fix: de-complicate earlier connection open logic"

This reverts commit d6b1b19.

Signed-off-by: varun-edachali-dbx <[email protected]>

* [empty commit] attempt to trigger ci e2e workflow

Signed-off-by: varun-edachali-dbx <[email protected]>

* Update CODEOWNERS (#562)

new codeowners

Signed-off-by: varun-edachali-dbx <[email protected]>

* 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: varun-edachali-dbx <[email protected]>

* PECOBLR-86 improve logging on python driver (#556)

* PECOBLR-86 Improve logging for debug level

Signed-off-by: Sai Shree Pradhan <[email protected]>

* PECOBLR-86 Improve logging for debug level

Signed-off-by: Sai Shree Pradhan <[email protected]>

* fixed format

Signed-off-by: Sai Shree Pradhan <[email protected]>

* used lazy logging

Signed-off-by: Sai Shree Pradhan <[email protected]>

* changed debug to error logs

Signed-off-by: Sai Shree Pradhan <[email protected]>

* used lazy logging

Signed-off-by: Sai Shree Pradhan <[email protected]>

---------

Signed-off-by: Sai Shree Pradhan <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "Merge remote-tracking branch 'upstream/sea-migration' into decouple-session"

This reverts commit dbb2ec5, reversing
changes made to 7192f11.

Signed-off-by: varun-edachali-dbx <[email protected]>

* Reapply "Merge remote-tracking branch 'upstream/sea-migration' into decouple-session"

This reverts commit bdb8381.

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: separate session opening logic from instantiation

ensures correctness of self.session.open call in Connection

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: use is_open attribute to denote session availability

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: access thrift backend through session

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: use get_handle() instead of private session attribute in client

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: remove accidentally removed assertions

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: Sai Shree Pradhan <[email protected]>
Co-authored-by: Jothi Prakash <[email protected]>
Co-authored-by: Madhav Sainanee <[email protected]>
Co-authored-by: Sai Shree Pradhan <[email protected]>
NOTE: the `test_complex_types` e2e test was not working at the time of this merge. The test must be triggered when the test is back up and running as intended. 

* remove excess logs, assertions, instantiations

large merge artifacts

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black) + remove excess log (merge artifact)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix typing

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary check

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary replace call

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce __str__ methods for CommandId and SessionId

Signed-off-by: varun-edachali-dbx <[email protected]>

* docstrings for DatabricksClient interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* stronger typing of Cursor and ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove utility functions from backend interface, fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* rename info to properties

Signed-off-by: varun-edachali-dbx <[email protected]>

* newline for cleanliness

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* to_hex_id -> get_hex_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* better comment on protocol version getter

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* move guid to hex id to new utils module

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* move staging allowed local path to connection props

Signed-off-by: varun-edachali-dbx <[email protected]>

* add strong return type for execute_command

Signed-off-by: varun-edachali-dbx <[email protected]>

* skip auth, error handling in databricksclient interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: docstring + line width

Signed-off-by: varun-edachali-dbx <[email protected]>

* get_id -> get_guid

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: to_hex_id -> to_hex_guid

Signed-off-by: varun-edachali-dbx <[email protected]>

---------
Signed-off-by: varun-edachali-dbx <[email protected]>
…574)

* ensure backend client returns a ResultSet type in backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* newline for cleanliness

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* to_hex_id -> get_hex_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* better comment on protocol version getter

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* stricter typing for cursor

Signed-off-by: varun-edachali-dbx <[email protected]>

* correct typing

Signed-off-by: varun-edachali-dbx <[email protected]>

* correct tests and merge artifacts

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove accidentally modified workflow files

remnants of old merge

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: remove accidentally modified workflow files

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back accidentally removed docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean up docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* log hex

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary _replace call

Signed-off-by: varun-edachali-dbx <[email protected]>

* add __str__ for CommandId

Signed-off-by: varun-edachali-dbx <[email protected]>

* take TOpenSessionResp in get_protocol_version to maintain existing interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* active_op_handle -> active_mmand_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* ensure None returned for close_command

Signed-off-by: varun-edachali-dbx <[email protected]>

* account for ResultSet return in new pydocs

Signed-off-by: varun-edachali-dbx <[email protected]>

* pydoc for types

Signed-off-by: varun-edachali-dbx <[email protected]>

* move common state to ResultSet aprent

Signed-off-by: varun-edachali-dbx <[email protected]>

* stronger typing in resultSet behaviour

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundant patch in test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add has_been_closed_server_side assertion

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundancies in tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* more robust close check

Signed-off-by: varun-edachali-dbx <[email protected]>

* use normalised state in e2e test

Signed-off-by: varun-edachali-dbx <[email protected]>

* simplify corrected test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add line gaps after multi-line pydocs for consistency

Signed-off-by: varun-edachali-dbx <[email protected]>

* use normalised CommandState type in ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
* introduce http client (temp) and sea test file

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce verbosity

Signed-off-by: varun-edachali-dbx <[email protected]>

* redundant comment

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce redundancy, params and data separate

Signed-off-by: varun-edachali-dbx <[email protected]>

* rename client

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix type issues

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce repetition in request calls

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary elifs

Signed-off-by: varun-edachali-dbx <[email protected]>

* add newline at EOF

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
* [squashed from prev branch] introduce sea client with session open and close functionality

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove accidental changes to workflows (merge artifacts)

Signed-off-by: varun-edachali-dbx <[email protected]>

* pass test_input to get_protocol_version instead of session_id to maintain previous API

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black + line gaps after multi-line pydocs)

Signed-off-by: varun-edachali-dbx <[email protected]>

* use factory for backend instantiation

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix type issues

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundant comments

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce models for requests and responses

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove http client and test script

to prevent diff from showing up post http-client merge

Signed-off-by: varun-edachali-dbx <[email protected]>

* Introduce Sea HTTP Client and test script  (#583)

* introduce http client (temp) and sea test file

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce verbosity

Signed-off-by: varun-edachali-dbx <[email protected]>

* redundant comment

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce redundancy, params and data separate

Signed-off-by: varun-edachali-dbx <[email protected]>

* rename client

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix type issues

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce repetition in request calls

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary elifs

Signed-off-by: varun-edachali-dbx <[email protected]>

* add newline at EOF

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>

* CustomHttpClient -> SeaHttpClient

Signed-off-by: varun-edachali-dbx <[email protected]>

* redundant comment in backend client

Signed-off-by: varun-edachali-dbx <[email protected]>

* regex for warehouse_id instead of .split, remove excess imports and behaviour

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundant attributes

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* [nit] reduce nested code

Signed-off-by: varun-edachali-dbx <[email protected]>

* line gap after multi-line pydoc

Signed-off-by: varun-edachali-dbx <[email protected]>

* redundant imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* move sea backend and models into separate sea/ dir

Signed-off-by: varun-edachali-dbx <[email protected]>

* move http client into separate sea/ dir

Signed-off-by: varun-edachali-dbx <[email protected]>

* change commands to include ones in docs

Signed-off-by: varun-edachali-dbx <[email protected]>

* add link to sql-ref-parameters for session-confs

Signed-off-by: varun-edachali-dbx <[email protected]>

* add client side filtering for session confs, add note on warehouses over endoints

Signed-off-by: varun-edachali-dbx <[email protected]>

* test unimplemented methods and max_download_threads prop

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
* [squash from exec-sea] bring over execution phase changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remvoe exec func in sea backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess files

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess models

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess sea backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* cleanup

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove SeaResultSet

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean imports and attributes

Signed-off-by: varun-edachali-dbx <[email protected]>

* pass CommandId to ExecResp

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove changes in types

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back essential types (ExecResponse, from_sea_state)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix fetch types

Signed-off-by: varun-edachali-dbx <[email protected]>

* excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff by maintaining logs

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix int test types

Signed-off-by: varun-edachali-dbx <[email protected]>

* move guid_to_hex_id import to utils

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff in guid utils import

Signed-off-by: varun-edachali-dbx <[email protected]>

* move arrow_schema_bytes back into ExecuteResult

Signed-off-by: varun-edachali-dbx <[email protected]>

* maintain log

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary assignment

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary tuple response

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-ncessary verbose mocking

Signed-off-by: varun-edachali-dbx <[email protected]>

* move Queue construction to ResultSert

Signed-off-by: varun-edachali-dbx <[email protected]>

* move description to List[Tuple]

Signed-off-by: varun-edachali-dbx <[email protected]>

* frmatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff (remove explicit tuple conversion)

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove has_more_rows from ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary has_more_rows aclc

Signed-off-by: varun-edachali-dbx <[email protected]>

* default has_more_rows to True

Signed-off-by: varun-edachali-dbx <[email protected]>

* return has_more_rows from ExecResponse conversion during GetRespMetadata

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary replacement

Signed-off-by: varun-edachali-dbx <[email protected]>

* better mocked backend naming

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove has_more_rows test in ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce replacement of original has_more_rows read test

Signed-off-by: varun-edachali-dbx <[email protected]>

* call correct method in test_use_arrow_schema

Signed-off-by: varun-edachali-dbx <[email protected]>

* call correct method in test_fall_back_to_hive_schema

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce result response read test

Signed-off-by: varun-edachali-dbx <[email protected]>

* simplify test

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess fetch_results mocks

Signed-off-by: varun-edachali-dbx <[email protected]>

* more minimal changes to thrift_backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* move back to old table types

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove outdated arrow_schema_bytes return

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove duplicate import

Signed-off-by: varun-edachali-dbx <[email protected]>

* rephrase model docstrings to explicitly denote that they are representations and not used over the wire

Signed-off-by: varun-edachali-dbx <[email protected]>

* has_more_rows -> is_direct_results

Signed-off-by: varun-edachali-dbx <[email protected]>

* switch docstring format to align with Connection class

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
* [squash from exec-sea] bring over execution phase changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remvoe exec func in sea backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess files

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess models

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess sea backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* cleanup

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove SeaResultSet

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean imports and attributes

Signed-off-by: varun-edachali-dbx <[email protected]>

* pass CommandId to ExecResp

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove changes in types

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back essential types (ExecResponse, from_sea_state)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix fetch types

Signed-off-by: varun-edachali-dbx <[email protected]>

* excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff by maintaining logs

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix int test types

Signed-off-by: varun-edachali-dbx <[email protected]>

* [squashed from exec-sea] init execution func

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove ResultSetFilter functionality

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* even more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove sea response as init option

Signed-off-by: varun-edachali-dbx <[email protected]>

* exec test example scripts

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* [squashed from sea-exec] merge sea stuffs

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess removed docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes in backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove accidentally removed _get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary init with sea_response tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* rmeove unnecessary changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* improved models and filters from cloudfetch-sea branch

Signed-off-by: varun-edachali-dbx <[email protected]>

* filters stuff (align with JDBC)

Signed-off-by: varun-edachali-dbx <[email protected]>

* backend from cloudfetch-sea

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove filtering, metadata ops

Signed-off-by: varun-edachali-dbx <[email protected]>

* raise NotImplementedErrror for metadata ops

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary backend cahnges

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-needed GetChunksResponse

only relevant in Fetch phase

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce code duplication

Signed-off-by: varun-edachali-dbx <[email protected]>

* more clear docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce strongly typed ChunkInfo

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove is_volume_operation from response

Signed-off-by: varun-edachali-dbx <[email protected]>

* add is_volume_op and more ResultData fields

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
* [squash from exec-sea] bring over execution phase changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remvoe exec func in sea backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess files

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess models

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess sea backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* cleanup

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove SeaResultSet

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean imports and attributes

Signed-off-by: varun-edachali-dbx <[email protected]>

* pass CommandId to ExecResp

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove changes in types

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back essential types (ExecResponse, from_sea_state)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix fetch types

Signed-off-by: varun-edachali-dbx <[email protected]>

* excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff by maintaining logs

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix int test types

Signed-off-by: varun-edachali-dbx <[email protected]>

* [squashed from exec-sea] init execution func

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove ResultSetFilter functionality

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* even more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove sea response as init option

Signed-off-by: varun-edachali-dbx <[email protected]>

* move guid_to_hex_id import to utils

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff in guid utils import

Signed-off-by: varun-edachali-dbx <[email protected]>

* move arrow_schema_bytes back into ExecuteResult

Signed-off-by: varun-edachali-dbx <[email protected]>

* maintain log

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary assignment

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary tuple response

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-ncessary verbose mocking

Signed-off-by: varun-edachali-dbx <[email protected]>

* move Queue construction to ResultSert

Signed-off-by: varun-edachali-dbx <[email protected]>

* move description to List[Tuple]

Signed-off-by: varun-edachali-dbx <[email protected]>

* frmatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff (remove explicit tuple conversion)

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove has_more_rows from ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary has_more_rows aclc

Signed-off-by: varun-edachali-dbx <[email protected]>

* default has_more_rows to True

Signed-off-by: varun-edachali-dbx <[email protected]>

* return has_more_rows from ExecResponse conversion during GetRespMetadata

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary replacement

Signed-off-by: varun-edachali-dbx <[email protected]>

* better mocked backend naming

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove has_more_rows test in ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce replacement of original has_more_rows read test

Signed-off-by: varun-edachali-dbx <[email protected]>

* call correct method in test_use_arrow_schema

Signed-off-by: varun-edachali-dbx <[email protected]>

* call correct method in test_fall_back_to_hive_schema

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce result response read test

Signed-off-by: varun-edachali-dbx <[email protected]>

* simplify test

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess fetch_results mocks

Signed-off-by: varun-edachali-dbx <[email protected]>

* more minimal changes to thrift_backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* move back to old table types

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove outdated arrow_schema_bytes return

Signed-off-by: varun-edachali-dbx <[email protected]>

* align SeaResultSet with new structure

Signed-off-by: varun-edachali-dbx <[email protected]>

* correct sea res set tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove duplicate import

Signed-off-by: varun-edachali-dbx <[email protected]>

* rephrase model docstrings to explicitly denote that they are representations and not used over the wire

Signed-off-by: varun-edachali-dbx <[email protected]>

* has_more_rows -> is_direct_results

Signed-off-by: varun-edachali-dbx <[email protected]>

* switch docstring format to align with Connection class

Signed-off-by: varun-edachali-dbx <[email protected]>

* has_more_rows -> is_direct_results

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix type errors with arrow_schema_bytes

Signed-off-by: varun-edachali-dbx <[email protected]>

* spaces after multi line pydocs

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove duplicate queue init (merge artifact)

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff (remove newlines)

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary changes

covered by #588 anyway

Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "remove un-necessary changes"

This reverts commit a70a6ce.

Signed-off-by: varun-edachali-dbx <[email protected]>

* b"" -> None

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
* decouple session class from existing Connection

ensure maintenance of current APIs of Connection while delegating
responsibility

Signed-off-by: varun-edachali-dbx <[email protected]>

* add open property to Connection to ensure maintenance of existing API

Signed-off-by: varun-edachali-dbx <[email protected]>

* update unit tests to address ThriftBackend through session instead of through Connection

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: move session specific tests from test_client to test_session

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

as in CONTRIBUTING.md

Signed-off-by: varun-edachali-dbx <[email protected]>

* use connection open property instead of long chain through session

Signed-off-by: varun-edachali-dbx <[email protected]>

* trigger integration workflow

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: ensure open attribute of Connection never fails

in case the openSession takes long, the initialisation of the session
will not complete immediately. This could make the session attribute
inaccessible. If the Connection is deleted in this time, the open()
check will throw because the session attribute does not exist. Thus, we
default to the Connection being closed in this case. This was not an
issue before because open was a direct attribute of the Connection
class. Caught in the integration tests.

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: de-complicate earlier connection open logic

earlier, one of the integration tests was failing because 'session was
not an attribute of Connection'. This is likely tied to a local
configuration issue related to unittest that was causing an error in the
test suite itself. The tests are now passing without checking for the
session attribute.
c676f9b

Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "fix: de-complicate earlier connection open logic"

This reverts commit d6b1b19.

Signed-off-by: varun-edachali-dbx <[email protected]>

* [empty commit] attempt to trigger ci e2e workflow

Signed-off-by: varun-edachali-dbx <[email protected]>

* Update CODEOWNERS (#562)

new codeowners

Signed-off-by: varun-edachali-dbx <[email protected]>

* 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: varun-edachali-dbx <[email protected]>

* PECOBLR-86 improve logging on python driver (#556)

* PECOBLR-86 Improve logging for debug level

Signed-off-by: Sai Shree Pradhan <[email protected]>

* PECOBLR-86 Improve logging for debug level

Signed-off-by: Sai Shree Pradhan <[email protected]>

* fixed format

Signed-off-by: Sai Shree Pradhan <[email protected]>

* used lazy logging

Signed-off-by: Sai Shree Pradhan <[email protected]>

* changed debug to error logs

Signed-off-by: Sai Shree Pradhan <[email protected]>

* used lazy logging

Signed-off-by: Sai Shree Pradhan <[email protected]>

---------

Signed-off-by: Sai Shree Pradhan <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "Merge remote-tracking branch 'upstream/sea-migration' into decouple-session"

This reverts commit dbb2ec5, reversing
changes made to 7192f11.

Signed-off-by: varun-edachali-dbx <[email protected]>

* Reapply "Merge remote-tracking branch 'upstream/sea-migration' into decouple-session"

This reverts commit bdb8381.

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: separate session opening logic from instantiation

ensures correctness of self.session.open call in Connection

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: use is_open attribute to denote session availability

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: access thrift backend through session

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: use get_handle() instead of private session attribute in client

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: remove accidentally removed assertions

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: Sai Shree Pradhan <[email protected]>
Co-authored-by: Jothi Prakash <[email protected]>
Co-authored-by: Madhav Sainanee <[email protected]>
Co-authored-by: Sai Shree Pradhan <[email protected]>
NOTE: the `test_complex_types` e2e test was not working at the time of this merge. The test must be triggered when the test is back up and running as intended. 

* remove excess logs, assertions, instantiations

large merge artifacts

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black) + remove excess log (merge artifact)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix typing

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary check

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary replace call

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce __str__ methods for CommandId and SessionId

Signed-off-by: varun-edachali-dbx <[email protected]>

* docstrings for DatabricksClient interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* stronger typing of Cursor and ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove utility functions from backend interface, fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* rename info to properties

Signed-off-by: varun-edachali-dbx <[email protected]>

* newline for cleanliness

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* to_hex_id -> get_hex_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* better comment on protocol version getter

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* move guid to hex id to new utils module

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* move staging allowed local path to connection props

Signed-off-by: varun-edachali-dbx <[email protected]>

* add strong return type for execute_command

Signed-off-by: varun-edachali-dbx <[email protected]>

* skip auth, error handling in databricksclient interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: docstring + line width

Signed-off-by: varun-edachali-dbx <[email protected]>

* get_id -> get_guid

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: to_hex_id -> to_hex_guid

Signed-off-by: varun-edachali-dbx <[email protected]>

---------
Signed-off-by: varun-edachali-dbx <[email protected]>
…574)

* ensure backend client returns a ResultSet type in backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* newline for cleanliness

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix circular import

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* to_hex_id -> get_hex_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* better comment on protocol version getter

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* stricter typing for cursor

Signed-off-by: varun-edachali-dbx <[email protected]>

* correct typing

Signed-off-by: varun-edachali-dbx <[email protected]>

* correct tests and merge artifacts

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove accidentally modified workflow files

remnants of old merge

Signed-off-by: varun-edachali-dbx <[email protected]>

* chore: remove accidentally modified workflow files

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back accidentally removed docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean up docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* log hex

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary _replace call

Signed-off-by: varun-edachali-dbx <[email protected]>

* add __str__ for CommandId

Signed-off-by: varun-edachali-dbx <[email protected]>

* take TOpenSessionResp in get_protocol_version to maintain existing interface

Signed-off-by: varun-edachali-dbx <[email protected]>

* active_op_handle -> active_mmand_id

Signed-off-by: varun-edachali-dbx <[email protected]>

* ensure None returned for close_command

Signed-off-by: varun-edachali-dbx <[email protected]>

* account for ResultSet return in new pydocs

Signed-off-by: varun-edachali-dbx <[email protected]>

* pydoc for types

Signed-off-by: varun-edachali-dbx <[email protected]>

* move common state to ResultSet aprent

Signed-off-by: varun-edachali-dbx <[email protected]>

* stronger typing in resultSet behaviour

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundant patch in test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add has_been_closed_server_side assertion

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundancies in tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* more robust close check

Signed-off-by: varun-edachali-dbx <[email protected]>

* use normalised state in e2e test

Signed-off-by: varun-edachali-dbx <[email protected]>

* simplify corrected test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add line gaps after multi-line pydocs for consistency

Signed-off-by: varun-edachali-dbx <[email protected]>

* use normalised CommandState type in ExecuteResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
* [squash from exec-sea] bring over execution phase changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess test

Signed-off-by: varun-edachali-dbx <[email protected]>

* add docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remvoe exec func in sea backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess files

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess models

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess sea backend tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* cleanup

Signed-off-by: varun-edachali-dbx <[email protected]>

* re-introduce get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove SeaResultSet

Signed-off-by: varun-edachali-dbx <[email protected]>

* clean imports and attributes

Signed-off-by: varun-edachali-dbx <[email protected]>

* pass CommandId to ExecResp

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove changes in types

Signed-off-by: varun-edachali-dbx <[email protected]>

* add back essential types (ExecResponse, from_sea_state)

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix fetch types

Signed-off-by: varun-edachali-dbx <[email protected]>

* excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff by maintaining logs

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix int test types

Signed-off-by: varun-edachali-dbx <[email protected]>

* [squashed from exec-sea] init execution func

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove ResultSetFilter functionality

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* even more irrelevant changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove sea response as init option

Signed-off-by: varun-edachali-dbx <[email protected]>

* exec test example scripts

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* [squashed from sea-exec] merge sea stuffs

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess removed docstring

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes in backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove accidentally removed _get_schema_desc

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unnecessary init with sea_response tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* rmeove unnecessary changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* improved models and filters from cloudfetch-sea branch

Signed-off-by: varun-edachali-dbx <[email protected]>

* filters stuff (align with JDBC)

Signed-off-by: varun-edachali-dbx <[email protected]>

* backend from cloudfetch-sea

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove filtering, metadata ops

Signed-off-by: varun-edachali-dbx <[email protected]>

* raise NotImplementedErrror for metadata ops

Signed-off-by: varun-edachali-dbx <[email protected]>

* change to valid table name

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary changes

covered by #588

Signed-off-by: varun-edachali-dbx <[email protected]>

* simplify test module

Signed-off-by: varun-edachali-dbx <[email protected]>

* logging -> debug level

Signed-off-by: varun-edachali-dbx <[email protected]>

* change table name in log

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary backend cahnges

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-needed GetChunksResponse

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-needed GetChunksResponse

only relevant in Fetch phase

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce code duplication in response parsing

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce code duplication

Signed-off-by: varun-edachali-dbx <[email protected]>

* more clear docstrings

Signed-off-by: varun-edachali-dbx <[email protected]>

* introduce strongly typed ChunkInfo

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove is_volume_operation from response

Signed-off-by: varun-edachali-dbx <[email protected]>

* add is_volume_op and more ResultData fields

Signed-off-by: varun-edachali-dbx <[email protected]>

* add test scripts

Signed-off-by: varun-edachali-dbx <[email protected]>

* Revert "Merge branch 'exec-models-sea' into exec-phase-sea"

This reverts commit be1997e, reversing
changes made to 37813ba.

* change logging level

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove excess changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove _get_schema_bytes (for now)

Signed-off-by: varun-edachali-dbx <[email protected]>

* redundant comments

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove fetch phase methods

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce code repetititon + introduce gaps after multi line pydocs

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove unused imports

Signed-off-by: varun-edachali-dbx <[email protected]>

* move description extraction to helper func

Signed-off-by: varun-edachali-dbx <[email protected]>

* formatting (black)

Signed-off-by: varun-edachali-dbx <[email protected]>

* add more unit tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* streamline unit tests

Signed-off-by: varun-edachali-dbx <[email protected]>

* test getting the list of allowed configurations

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff

Signed-off-by: varun-edachali-dbx <[email protected]>

* reduce diff

Signed-off-by: varun-edachali-dbx <[email protected]>

* house constants in enums for readability and immutability

Signed-off-by: varun-edachali-dbx <[email protected]>

* add note on hybrid disposition

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove redundant note on arrow_schema_bytes

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove invalid import

Signed-off-by: varun-edachali-dbx <[email protected]>

* add strong typing for manifest in _extract_description

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove un-necessary column skipping

Signed-off-by: varun-edachali-dbx <[email protected]>

* remove parsing in backend

Signed-off-by: varun-edachali-dbx <[email protected]>

* fix: convert sea statement id to CommandId type

Signed-off-by: varun-edachali-dbx <[email protected]>

* make polling interval a separate constant

Signed-off-by: varun-edachali-dbx <[email protected]>

* align state checking with Thrift implementation

Signed-off-by: varun-edachali-dbx <[email protected]>

* update unit tests according to changes

Signed-off-by: varun-edachali-dbx <[email protected]>

* add unit tests for added methods

Signed-off-by: varun-edachali-dbx <[email protected]>

* add spec to description extraction docstring, add strong typing to params

Signed-off-by: varun-edachali-dbx <[email protected]>

* add strong typing for backend parameters arg

Signed-off-by: varun-edachali-dbx <[email protected]>

---------

Signed-off-by: varun-edachali-dbx <[email protected]>
…nd forward refs, remove some unused imports

Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Signed-off-by: varun-edachali-dbx <[email protected]>
Copy link
Contributor

@jayantsing-db jayantsing-db left a comment

Choose a reason for hiding this comment

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

Some minor questions/suggestions. Rest LGTM. thanks!

command_id = CommandId.from_sea_statement_id(statement_id)

# Store the command ID in the cursor
cursor.active_command_id = command_id
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the spec for active_command_id? what is the lifecycle? Does it remain set to previous command_id until a new one comes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's right. It is set to some command id when execute is invoked on the Cursor. From then on, it is essentially used to track the active operation and is passed into the backend methods for operations that require it, eg: when cancel() is invoked on the Cursor we pass the command id into the backend's cancel_command method.

It is only re-set when a new one comes in (through another execute) or when the Cursor is closed - at which point it becomes None.

I think it makes sense to eventually remove this attribute and store it as an attribute of the ResultSet, since the active_result_set of the Cursor essentially has the same life cycle and is also associated with a command.

@databricks databricks deleted a comment from github-actions bot Jul 22, 2025
@databricks databricks deleted a comment from github-actions bot Jul 22, 2025
@databricks databricks deleted a comment from github-actions bot Jul 22, 2025
Signed-off-by: varun-edachali-dbx <[email protected]>
@databricks databricks deleted a comment from github-actions bot Jul 23, 2025
@databricks databricks deleted a comment from github-actions bot Jul 23, 2025
@databricks databricks deleted a comment from github-actions bot Jul 23, 2025
@databricks databricks deleted a comment from github-actions bot Jul 23, 2025
@databricks databricks deleted a comment from github-actions bot Jul 23, 2025
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.

3 participants