Skip to content

Conversation

@mfonekpo
Copy link
Contributor

@mfonekpo mfonekpo commented Jul 23, 2024

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.

mfonekpo and others added 30 commits July 11, 2024 22:08
@mfonekpo
Copy link
Contributor Author

mfonekpo commented Jul 25, 2024 via email

@mfonekpo
Copy link
Contributor Author

mfonekpo commented Jul 28, 2024 via email

@MarcoGorelli
Copy link
Member

yup, definitely room for growth :) it's OK, if you add the test I suggested and it passes, then it should be fine

@mfonekpo
Copy link
Contributor Author

mfonekpo commented Jul 28, 2024 via email

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks for updating πŸ™ ! have left a few comments

In general, I'd suggest that before asking for a review, you click on "files changed" and look through your changes yourself - it happens quite often that extra changes end up there which shouldn't be there. This fine is fine whilst learning 🀠 I'm just pointing it out so you know how to improve

Comment on lines 14 to 15
def test_shift(constructor_eager: Any) -> None:
df = nw.from_native(constructor_eager(data), eager_only=True)
Copy link
Member

@MarcoGorelli MarcoGorelli Jul 29, 2024

Choose a reason for hiding this comment

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

these don't need to change in this test - only in test_shift_series did you need to do that, constructor is fine here, because we're testing Expr.shift

Suggested change
def test_shift(constructor_eager: Any) -> None:
df = nw.from_native(constructor_eager(data), eager_only=True)
def test_shift(constructor: Any) -> None:
df = nw.from_native(constructor(data))

Copy link
Member

Choose a reason for hiding this comment

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

could you address this comment please?

Copy link
Member

@MarcoGorelli MarcoGorelli Aug 6, 2024

Choose a reason for hiding this comment

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

This still needs addressing, could you read over the suggested change more carefully and address it please?

You've removed the eager_only part, but you still need to rename constructor_eager to constructor (just for this test!)

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

I've added a commit to get this through

A bit of general feedback:

  • in tests, you should construct expected explicitly, without any logic. The test case I handed you was like this, there was no need to modify it
  • the implementation for shift wasn't quite right. I'd pointed you to the solution (https://stackoverflow.com/a/78805975/4451315), why not try to just use that?

Anyway, thanks for your work here πŸ’ͺ let's ship it

@MarcoGorelli MarcoGorelli merged commit a0d94f1 into narwhals-dev:main Aug 7, 2024
@mfonekpo
Copy link
Contributor Author

mfonekpo commented Aug 7, 2024 via email

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