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

Add python api for optimize #1091

Closed

Conversation

burakyilmaz321
Copy link
Contributor

@burakyilmaz321 burakyilmaz321 commented Apr 21, 2022

  • Unit tests
  • Documentation

Description

Adds optimize command to the Python API.

  • New class in tables.py: DeltaOptimizeBuilder
  • New method: DeltaTable.optimize

Resolves #1080

How was this patch tested?

Added new unit tests to test_deltatable.py:

  • test_optimize
  • test_optimize_w_partition_filter

Does this PR introduce any user-facing changes?

No

@vkorukanti
Copy link
Collaborator

@burakyilmaz321 Thank you for the PR. This is very good! For tests, you can look at the the examples here.

@burakyilmaz321 burakyilmaz321 changed the title [WIP] Add python api for optimize Add python api for optimize Apr 24, 2022
@burakyilmaz321
Copy link
Contributor Author

@vkorukanti Added unit tests and documentation. Since the Scala API is not added yet, tests are failing here. But, I merged #961 with my changes in another branch, just to see that unit tests are passing. You can see here the unit test checks are successful.

@tdas tdas requested a review from vkorukanti April 28, 2022 19:22
@burakyilmaz321 burakyilmaz321 requested a review from vkorukanti May 3, 2022 15:03
Copy link
Collaborator

@vkorukanti vkorukanti left a comment

Choose a reason for hiding this comment

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

Thank you @burakyilmaz321 for the update. Few minor comments. The Scala API is merged to master branch.

Signed-off-by: Burak Yilmaz <[email protected]>
It cannot decorate classes

Signed-off-by: Burak Yilmaz <[email protected]>
It's better to have a consistent naming between APIs.

Signed-off-by: Burak Yilmaz <[email protected]>
After Python 3.6, there should not be escape characters in literal
strings. Currently, it is just a lint issue. But it will eventually
raise a SyntaxError in the future.

Just make them raw strings to fix the issue.

https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

Signed-off-by: Burak Yilmaz <[email protected]>
Signed-off-by: Burak Yilmaz <[email protected]>
@burakyilmaz321 burakyilmaz321 force-pushed the python-api-optimize branch from 013aa48 to 9ec76f0 Compare May 4, 2022 12:51
Copy link
Collaborator

@vkorukanti vkorukanti left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for adding these APIs.

@vkorukanti
Copy link
Collaborator

@burakyilmaz321 The python test failures on master branch are fixed now. Could you please rebase this PR? Thank you!

@burakyilmaz321
Copy link
Contributor Author

@burakyilmaz321 The python test failures on master branch are fixed now. Could you please rebase this PR? Thank you!

Sure, I will do that as soon as I reach my laptop later today.

@burakyilmaz321 burakyilmaz321 requested a review from vkorukanti May 10, 2022 08:22
@vkorukanti vkorukanti added this to the 2.0 milestone Jun 28, 2022
jbguerraz pushed a commit to jbguerraz/delta that referenced this pull request Jul 6, 2022
## Description

Adds optimize command to the Python API.

- New class in ``tables.py``:  ``DeltaOptimizeBuilder``
- New method: ``DeltaTable.optimize``

Resolves delta-io#1080

Added new unit tests to ``test_deltatable.py``:

- ``test_optimize``
- ``test_optimize_w_partition_filter``

## Does this PR introduce _any_ user-facing changes?

No

Closes delta-io#1091

Signed-off-by: Venki Korukanti <[email protected]>
GitOrigin-RevId: 93ede77656227f068c1cd32157e6cc46a78922e8
jbguerraz pushed a commit to jbguerraz/delta that referenced this pull request Jul 6, 2022
## Description

Adds optimize command to the Python API.

- New class in ``tables.py``:  ``DeltaOptimizeBuilder``
- New method: ``DeltaTable.optimize``

Resolves delta-io#1080

Added new unit tests to ``test_deltatable.py``:

- ``test_optimize``
- ``test_optimize_w_partition_filter``

## Does this PR introduce _any_ user-facing changes?

No

Closes delta-io#1091

Signed-off-by: Venki Korukanti <[email protected]>
GitOrigin-RevId: 93ede77656227f068c1cd32157e6cc46a78922e8
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.

Add pypsark api for Optimize
2 participants