Skip to content

Add empty DataFrame check to boundary_slice#4212

Merged
mrocklin merged 2 commits intodask:masterfrom
jrbourbeau:sequential-df-joins
Nov 15, 2018
Merged

Add empty DataFrame check to boundary_slice#4212
mrocklin merged 2 commits intodask:masterfrom
jrbourbeau:sequential-df-joins

Conversation

@jrbourbeau
Copy link
Copy Markdown
Member

@jrbourbeau jrbourbeau commented Nov 15, 2018

Closes #4211. It looks like the bug in #4211 is due to empty DataFrames being passed to boundary_slice() in dask/dataframe/methods.py. This PR adds a check in boundary_slice to handle when empty DataFrames are input. Specifically, the empty DataFrame is returned by boundary_slice. E.g.

>>> df_empty = pd.DataFrame()
>>> boundary_slice(df_empty, 1, 3)
Empty DataFrame
Columns: []
Index: []

I'd be curious to see what other think about this. Definitely open to suggestions.

  • Tests added / passed
  • Passes flake8 dask

Copy link
Copy Markdown
Member

@mrocklin mrocklin left a comment

Choose a reason for hiding this comment

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

This seems great to me. Thanks for tracking this down @jrbourbeau .

Merging in an hour if there are no further comments.

@mrocklin mrocklin merged commit 94b07ea into dask:master Nov 15, 2018
@mrocklin
Copy link
Copy Markdown
Member

Merged. Thanks @jrbourbeau !

@jrbourbeau jrbourbeau deleted the sequential-df-joins branch November 15, 2018 14:51
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.

2 participants