-
-
Notifications
You must be signed in to change notification settings - Fork 145
for #392 #403
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
for #392 #403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test for this. You can use the example from #392
added the tests sir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing because you have to run black
on the source.
@@ -1915,3 +1915,8 @@ def f(s: pd.DataFrame) -> pd.Series: | |||
return s.mean() | |||
|
|||
check(assert_type(resampler.apply(f), Union[pd.Series, pd.DataFrame]), pd.DataFrame) | |||
|
|||
|
|||
def df_accepting_dicts_iterator() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here to reference the original issue, i..e., # GH 392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done sir
tests/test_frame.py
Outdated
@@ -1915,3 +1915,8 @@ def f(s: pd.DataFrame) -> pd.Series: | |||
return s.mean() | |||
|
|||
check(assert_type(resampler.apply(f), Union[pd.Series, pd.DataFrame]), pd.DataFrame) | |||
|
|||
|
|||
def df_accepting_dicts_iterator() -> None: # GH 392 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this comment on its own line (see elsewhere for examples of this)
You also have extra spaces on the two lines above. Make sure you run black
on your files before you commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and ran black
tests/test_frame.py
Outdated
def df_accepting_dicts_iterator() -> None: | ||
# GH 392 | ||
data = [{"a": 1, "b": 2}, {"a": 3, "b": 5}] | ||
p = pd.DataFrame(iter(data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing. Can you change this last line to:
check(assert_type(pd.DataFrame(iter(data)), pd.DataFrame), pd.DataFrame)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tests/test_frame.py
Outdated
@@ -1915,3 +1915,9 @@ def f(s: pd.DataFrame) -> pd.Series: | |||
return s.mean() | |||
|
|||
check(assert_type(resampler.apply(f), Union[pd.Series, pd.DataFrame]), pd.DataFrame) | |||
|
|||
|
|||
def df_accepting_dicts_iterator() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to make sure you run black
before committing. You have an extra space at the end of this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done Sir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @ramvikrams
Welcome sir you helped a lot |
added dict
assert_type()
to assert the type of any return value