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

feat: implement LazyFrame.head for Dask (plus: run tpc-h q2 query with Dask present) #768

Merged
merged 17 commits into from
Aug 12, 2024

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Aug 10, 2024

I also added head to make sure this notebook could run

drive-by:

  • remove the ibis-framework install from other notebooks (as we'll no longer benchmark running pandas/dask via ibis anyway)
  • specify minimum dask version in pyproject.toml, add a separate CI job for the minimum dask version

What type of PR is this? (check all applicable)

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

  • Related issue #
  • Closes #

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below.

@github-actions github-actions bot added the enhancement New feature or request label Aug 10, 2024
@MarcoGorelli MarcoGorelli marked this pull request as ready for review August 10, 2024 10:00
@MarcoGorelli MarcoGorelli changed the title feat: run Dask tpch Q2 feat: implement LazyFrame.head for Dask (plus: run tpc-h q2 query with Dask present) Aug 10, 2024
Copy link
Member

@FBruzzesi FBruzzesi left a comment

Choose a reason for hiding this comment

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

Left couple of comments, didn't check the notebook though 🙃

python-version: ${{ matrix.python-version }}
- name: Install uv (Unix)
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: install-minimu-versions
Copy link
Member

Choose a reason for hiding this comment

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

Tiny typo

Suggested change
- name: install-minimu-versions
- name: install-minimum-versions

@@ -136,6 +140,11 @@ def with_row_index(self: Self, name: str) -> Self:
def rename(self: Self, mapping: dict[str, str]) -> Self:
return self._from_native_dataframe(self._native_dataframe.rename(columns=mapping))

def head(self: Self, n: int) -> Self:
return self._from_native_dataframe(
self._native_dataframe.head(n=n, compute=False)
Copy link
Member

Choose a reason for hiding this comment

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

Should we also pass npartititions=-1 to parse all partitions if needed? I am not sure how this works: docs

Copy link
Member Author

Choose a reason for hiding this comment

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

good points, thanks

@MarcoGorelli
Copy link
Member Author

thanks for your review!

@MarcoGorelli MarcoGorelli merged commit 39be5d9 into narwhals-dev:main Aug 12, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants