Skip to content
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

[BUG] Koheesio 0.9.0 and Spark Connect: delta.connect present only on Databricks #101

Closed
YevIgn opened this issue Nov 11, 2024 · 2 comments · Fixed by #100 or #130
Closed

[BUG] Koheesio 0.9.0 and Spark Connect: delta.connect present only on Databricks #101

YevIgn opened this issue Nov 11, 2024 · 2 comments · Fixed by #100 or #130
Labels
bug Something isn't working
Milestone

Comments

@YevIgn
Copy link

YevIgn commented Nov 11, 2024

Bug Description

When testing new version of Koheesio - #97

And issue is observed when using DeltaTableWriter.

--> 257 raise ValueError(
    258     "Provide `merge_builder` in "
    259     "DeltaTableWriter(output_mode_params={'merge_builder': DeltaMergeBuilder()}). "
    260     "See documentation for options."
    261 )

The problem stems from the code

if isinstance(merge_builder, DeltaMergeBuilder):
which checks specifically for delta.tables.DeltaMergeBuilder instance.

As there is no delta.connect.tables module in open-source delta-io package releases at the moment (2024.11.11) the possible way to resolve this issue is to check for class name or fully-qualified class name without connect part instead of using ininstance check as connect classes aren't subclasses of their regular counterparts.

Expected behavior

Using DeltaMergeBuilder doesn't fail if code is executed in Spark Connect mode on Databricks and DBR 15.4+

Environment

  • DBR 15.4
  • Koheesio 0.9.0rc0
    -->

Additional context

Same problem can happen with other classes from same namespaces delta.tables and delta.connect.tables in case Pydantic or other ways of type checking will check for first classes.

@YevIgn YevIgn added the bug Something isn't working label Nov 11, 2024
@dannymeijer dannymeijer added this to the 0.9.0 milestone Nov 11, 2024
@dannymeijer dannymeijer linked a pull request Nov 11, 2024 that will close this issue
9 tasks
@dannymeijer
Copy link
Member

#100 should fix this

@dannymeijer dannymeijer moved this to In progress in Koheesio Nov 11, 2024
@dannymeijer dannymeijer linked a pull request Nov 26, 2024 that will close this issue
9 tasks
dannymeijer added a commit that referenced this issue Nov 26, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
Additonal fixes for #101 and #102

## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->
#101, #102

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.

---------

Co-authored-by: Danny Meijer <[email protected]>
@YevIgn
Copy link
Author

YevIgn commented Nov 26, 2024

Validated on 0.9.0rc6, issue is no longer present.

@YevIgn YevIgn closed this as completed Nov 26, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Koheesio Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
2 participants