Skip to content

Implement SeaDatabricksClient (Complete Execution Spec) #590

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 82 commits into
base: sea-migration
Choose a base branch
from

Conversation

varun-edachali-dbx
Copy link
Collaborator

@varun-edachali-dbx varun-edachali-dbx commented Jun 9, 2025

What type of PR is this?

  • Feature

Description

  • Implement execution relevant methods in SeaDatabricksClient as defined in the DatabricksClient interface.
  • Does not implement metadata relevant methods.

How is this tested?

The coverage of SeaDatabricksClient by test_sea_backend.py's unit tests are as below.

Module Statements Missing Coverage Notes
backend.py (SeaDatabricksClient class) 165 2 99% Missing lines are TYPE_CHECKING imports (lines 11-12) which are not meant to be covered in runtime tests

Related Tickets & Documents

https://docs.google.com/document/d/1Y-eXLhNqqhrMVGnOlG8sdFrCxBTN1GdQvuKG4IfHmo0/edit?usp=sharing

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>
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>
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>
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>
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>
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>
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>
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>
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>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@databricks databricks deleted a comment from github-actions bot Jun 12, 2025
@varun-edachali-dbx varun-edachali-dbx marked this pull request as ready for review June 12, 2025 12:41
return cursor

@pytest.fixture
def thrift_session_id(self):
Copy link
Contributor

@samikshya-db samikshya-db Jun 12, 2025

Choose a reason for hiding this comment

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

why is this present in sea_backend test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's used to test how some methods respond to invalid session id's (i.e., ones constructed from thrift handles instead of sea).

manifest=_parse_manifest(data),
result=_parse_result(data),
status=parse_status(data),
manifest=parse_manifest(data),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explore if @dataclass makes this JSON deserialising cleaner?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Based on some exploration, there seem to be ways to serialise and deserialise dataclasses into JSON less explicitly, but I don't think it's a good idea for us:

  1. If we're looking for direct conversion (i.e., just ClassName(**json)): we cannot directly unpack nested JSON into nested dataclasses, which is a common use case for us (Chunks in ManifestData) - [StackOverflow discussion].
  2. Sometimes we want to convert the values into specific forms (with non-trivial conversion methods) before we store them in our types, eg: the state needs to be stored as CommandState in our models. We would have to define custom methods for this serialisation and de-serialisation, which can get quite verbose.

There are ways to help mitigate both of the above complexities, mainly by using third-party libraries, but I think the code in it's current form (with explicit conversion) is more readable.

Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Copy link

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 (git rebase -i main).

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