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

Fix Bug where _wrap handles Pandas DFs incorrectly #122

Merged
merged 2 commits into from
Dec 29, 2017

Conversation

geenen124
Copy link
Contributor

Closes #97

@EntilZha
Copy link
Owner

Thanks for the PR!

I took a look at the failed tests, and they look unrelated to the PR (version of lint checker upgraded and code hasn't been changed to adapt yet).

Things look good to me with the exception of a cleaner way of skipping the test if pandas isn't installed which I'll mention in a sec. Once that is changed then I'll merge, and fix those random lint errors.

self.assertEqual(result[1].to_list(), ['name2', 2])
self.assertEqual(result[2].to_list(), ['name1', 3])
self.assertEqual(result[3].to_list(), ['name2', 4])
except ImportError:
Copy link
Owner

Choose a reason for hiding this comment

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

You can use builtin skip test ability like here https://github.com/EntilZha/PyFunctional/blob/master/functional/test/test_util.py#L23. I would make a helper function like pandas_is_installed() and call that.

@@ -800,6 +800,21 @@ class A(object):
self.assertIsInstance(_wrap(A()), A)
self.assert_type(self.seq(l))

def test_wrap_pandas(self):
# pylint: disable=superfluous-parens
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure why this would be correctly throwing a lint error. Would you mind removing it, and if it turns out to be a lint error I disagree with I'll re-insert.

@codecov-io
Copy link

Codecov Report

Merging #122 into master will decrease coverage by 1.42%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
- Coverage    99.9%   98.47%   -1.43%     
==========================================
  Files          12       12              
  Lines        2149     2169      +20     
==========================================
- Hits         2147     2136      -11     
- Misses          2       33      +31
Impacted Files Coverage Δ
functional/pipeline.py 99.25% <71.42%> (-0.75%) ⬇️
functional/test/test_functional.py 99.73% <84.61%> (-0.27%) ⬇️
functional/io.py 90.9% <0%> (-9.1%) ⬇️
functional/transformations.py 96.44% <0%> (-3.56%) ⬇️
functional/test/test_streams.py 98.16% <0%> (-1.84%) ⬇️
functional/util.py 98.41% <0%> (-1.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9459ee3...60061ae. Read the comment docs.

@geenen124
Copy link
Contributor Author

I've used a similar decorator to the one you suggested 👍

@EntilZha
Copy link
Owner

Thanks for the fix! Great work, LGTM to merge

@EntilZha EntilZha merged commit 1d15f82 into EntilZha:master Dec 29, 2017
drachpy pushed a commit to drachpy/PyFunctional that referenced this pull request Jan 16, 2019
* Fix Bug where _wrap handles Pandas DFs incorrectly

* remove pylint ignore & clean pandas install check
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