Skip to content

Conversation

@luizvbo
Copy link
Contributor

@luizvbo luizvbo commented Sep 26, 2025

Rationale for this change

It replaces pre-commit with prek, which is almost 10x faster. prek is a port of pre-commit to rust.

Are these changes tested?

Yes. make lint is running locally

Are there any user-facing changes?

Only for developers, given that it affects make lint,

NOTE: I had to update the poetry.lock file with poetry lock, resulting in multiple changes. Maybe it's better to run again in your machine (I don't know if it's run automatically in the CI pipeline).

@luizvbo luizvbo marked this pull request as ready for review September 26, 2025 12:34
@luizvbo luizvbo marked this pull request as draft September 26, 2025 12:34
@luizvbo luizvbo force-pushed the replace-pre-commit-by-prek branch from 80b6728 to 2346c2b Compare September 26, 2025 12:44
@luizvbo luizvbo changed the title Replace pre-commit by prep-k Replace pre-commit by prek Sep 26, 2025
@luizvbo luizvbo marked this pull request as ready for review September 26, 2025 12:45
@luizvbo luizvbo force-pushed the replace-pre-commit-by-prek branch from 2346c2b to 256a370 Compare September 26, 2025 12:48
@luizvbo luizvbo marked this pull request as draft September 26, 2025 12:51
@luizvbo
Copy link
Contributor Author

luizvbo commented Sep 26, 2025

Closes #2533

@luizvbo luizvbo marked this pull request as ready for review September 26, 2025 13:31
@luizvbo
Copy link
Contributor Author

luizvbo commented Sep 26, 2025

Hello! Could you review this PR for me? Thanks in advance

@Fokko
Copy link
Contributor

Fokko commented Sep 26, 2025

Thanks for working on this! 🥳

NOTE: I had to update the poetry.lock file with poetry lock, resulting in multiple changes. Maybe it's better to run again in your machine (I don't know if it's run automatically in the CI pipeline).

This is not really an issue; however, running it from different machines (and also Dependabot does this) will result in more conflicts.

@luizvbo
Copy link
Contributor Author

luizvbo commented Sep 26, 2025

Strange... The tests are working in my machine (python 3.12), but failing in the CI (python 3.11). It's strange, because I didn't touch src. I think it might be caused by updating the packages in the poetry.lock file

@luizvbo
Copy link
Contributor Author

luizvbo commented Sep 30, 2025

@Fokko, I think the issue is fixed now (tests are passing locally with py 3.11). I had to set an upper limit for the datafusion package, given that tests fail in py3.11 after version 48.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Nice, this looks great @luizvbo! I'm positive, let's see what @kevinjqliu thinks!

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

LGTM

An improvement in runtime!

prek:   make lint  8.10s user 1.18s system 255% cpu 3.638 total
poetry: make lint  11.65s user 1.76s system 171% cpu 7.815 total

thrift-sasl = { version = ">=0.4.3", optional = true }
kerberos = {version = "^1.3.1", optional = true}
datafusion = { version = ">=45", optional = true }
datafusion = { version = ">=45,<49", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

i tested locally that this passes without the extra <49

poetry lock
make install
poetry run pytest tests/table/test_datafusion.py 

Copy link
Contributor

Choose a reason for hiding this comment

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

its fine to leave as is. due to limitations we actually cannot use datafusion 49, so this makes sense

@kevinjqliu kevinjqliu merged commit 4348ee8 into apache:main Oct 6, 2025
10 checks passed
@kevinjqliu
Copy link
Contributor

thank you @luizvbo and thanks @Fokko for the review

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