-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Pass kwargs from Index.to_series to pd.Series #18707
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18707 +/- ##
==========================================
+ Coverage 91.58% 91.59% +<.01%
==========================================
Files 153 153
Lines 51305 51315 +10
==========================================
+ Hits 46989 47000 +11
+ Misses 4316 4315 -1
Continue to review full report at Codecov.
|
@@ -994,9 +994,13 @@ def to_series(self, **kwargs): | |||
""" | |||
|
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.
instead of this, simply list the kwargs that we accept, name=None, index=None
and pass them thru.
pandas/core/indexes/datetimes.py
Outdated
@@ -928,7 +928,7 @@ def _get_time_micros(self): | |||
values = self._local_timestamps() | |||
return fields.get_time_micros(values) | |||
|
|||
def to_series(self, keep_tz=False): | |||
def to_series(self, keep_tz=False, **kwargs): |
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.
same
assert s.values is not idx.values | ||
assert s.index is idx | ||
assert s.name == idx.name | ||
|
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 can do this in 1 test
doc/source/whatsnew/v0.22.0.txt
Outdated
@@ -188,7 +188,8 @@ Other API Changes | |||
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`) | |||
- The default NA value for :class:`UInt64Index` has changed from 0 to ``NaN``, which impacts methods that mask with NA, such as ``UInt64Index.where()`` (:issue:`18398`) | |||
- Refactored ``setup.py`` to use ``find_packages`` instead of explicitly listing out all subpackages (:issue:`18535`) | |||
- Rearranged the order of keyword arguments in :func:`read_excel()` to align with :func:`read_csv()` (:pr:`16672`) | |||
- Rearranged the order of keyword arguments in :func:`read_excel()` to align with :func:`read_csv()` (:issue:`16672`) | |||
- :func:`DatetimeIndex.to_series` now allows kwargs which are passed to :class:`Series` constructor (:issue:`18699`) |
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.
just same we now only accept kwargs name,index
:func;`Index..to_series`
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.
actually, make this in the bug-fix section and not here
Completed requested changes and rebased. |
@jreback Changes have been made. Anything else that needs to be done? |
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
Please let me know if you have any questions