Skip to content

Arrow X Datasets Blog #1283

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

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from
Draft

Conversation

cakiki
Copy link
Contributor

@cakiki cakiki commented Jul 3, 2023

No description provided.

@cakiki cakiki marked this pull request as draft July 3, 2023 14:15
@lhoestq lhoestq requested review from lhoestq and mariosasko July 3, 2023 14:17
Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Awesome ! Just a few comments on the code blocks formatting and suggestions :)

Comment on lines +144 to +150
```python
python = dset.map(lambda table: table.filter(pc.field("lang") == "Python"), batched=True, batch_size=500_000, num_proc=10)
print(f'{python.num_rows:,}', "rows")
>>> 250,000 rows
CPU times: user 818 ms, sys: 255 ms, total: 1.07 s
Wall time: 3.46 s
```
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```python
python = dset.map(lambda table: table.filter(pc.field("lang") == "Python"), batched=True, batch_size=500_000, num_proc=10)
print(f'{python.num_rows:,}', "rows")
>>> 250,000 rows
CPU times: user 818 ms, sys: 255 ms, total: 1.07 s
Wall time: 3.46 s
```
```python
>>> %time python = dset.map(lambda table: table.filter(pc.field("lang") == "Python"), batched=True, batch_size=500_000, num_proc=10)
CPU times: user 818 ms, sys: 255 ms, total: 1.07 s
Wall time: 3.46 s
>>> print(f'{python.num_rows:,}', "rows")
250,000 rows
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can use the standard lib for measuring time instead of the magic commands so that this code works in the (standard) REPL

Copy link
Contributor

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

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

Nice! Some comments:

cakiki and others added 10 commits July 11, 2023 20:48
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.

4 participants