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

Fixed sorting data frames with no dimensions #185

Merged
merged 2 commits into from
Sep 12, 2018

Conversation

twheys
Copy link
Contributor

@twheys twheys commented Sep 11, 2018

Fixed another issue related to sorting data frames in the pandas transformer when there are no dimensions

@@ -121,7 +121,7 @@ def pivot_data_frame(self, data_frame, pivot=(), transpose=False):
.fillna(value='')

def sort_data_frame(self, data_frame):
if not self.sort:
if not self.sort or len(data_frame) == 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the implication of having len(data_frame) == 1 here? Perhaps it'd be better to have a variable named has_some_property or is_some_property, which would be used in this if, so that people know why len(data_frame) == 1 must return the dataframe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is quite literal. If the data frame has one row, then sorting it would not yield any effect. I can add a comment.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.132% when pulling 736ea97 on fix_sorting_in_pandas_tx_for_no_index into 3e3fcc2 on fireant1.0.

@twheys twheys merged commit 60dc5dd into fireant1.0 Sep 12, 2018
@twheys twheys deleted the fix_sorting_in_pandas_tx_for_no_index branch September 12, 2018 13:44
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

3 participants