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

Replace a couple of deprecations with updated methods #21

Merged
merged 3 commits into from
Jun 9, 2023

Conversation

j-bennet
Copy link
Collaborator

Minor cleanup:

  • DeltaTable.pyarrow_schema is deprecated
  • _filters_to_expression is deprecated
  • add missing return.

@j-bennet j-bennet changed the title Replace a couple of pyarrow deprecations with updated methods. Replace a couple of deprecations with updated methods May 31, 2023
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

Thanks @j-bennet -- looks like the linter is complaining

@j-bennet
Copy link
Collaborator Author

Thanks @j-bennet -- looks like the linter is complaining

Yes, just took care of it.

@codecov-commenter
Copy link

codecov-commenter commented May 31, 2023

Codecov Report

Merging #21 (a2c665e) into main (cd731a9) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   94.54%   94.54%           
=======================================
  Files           2        2           
  Lines         110      110           
=======================================
  Hits          104      104           
  Misses          6        6           
Impacted Files Coverage Δ
dask_deltatable/core.py 94.49% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@j-bennet j-bennet requested a review from jrbourbeau May 31, 2023 23:15
@j-bennet
Copy link
Collaborator Author

j-bennet commented Jun 2, 2023

@jrbourbeau Linter is fixed.

Copy link
Collaborator

@milesgranger milesgranger left a comment

Choose a reason for hiding this comment

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

Looks great to me!

Copy link
Collaborator

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Thanks @j-bennet! One small comment.

Comment on lines 52 to 55
filter_converter = getattr(
pq, "filters_to_expression", getattr(pq, "_filters_to_expression")
)
filter_expression = filter_converter(filter)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing this is to handle a private method that has been made public in pyarrow?

I wonder if it would feel more pythonic and readable to use a try/except here and ask forgiveness not permission?

Suggested change
filter_converter = getattr(
pq, "filters_to_expression", getattr(pq, "_filters_to_expression")
)
filter_expression = filter_converter(filter)
try:
filter_expression = pq._filters_to_expression(filter)
except AttributeError:
filter_expression = pq.filters_to_expression(filter)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, changed.

Copy link
Collaborator

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

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

Thanks, @j-bennet!

@jrbourbeau
Copy link
Member

Looks like uploading to codecov failed for some CI jobs. I've bumped CI to see if this was just a transient thing or not

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

Thanks @j-bennet!

@jrbourbeau jrbourbeau merged commit 61b9e0f into dask-contrib:main Jun 9, 2023
16 checks passed
@j-bennet j-bennet deleted the j-bennet/minor-deprecations branch June 9, 2023 18:07
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.

None yet

6 participants