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

BUG: Pass kwargs from Index.to_series to pd.Series #18707

Merged
merged 4 commits into from Dec 13, 2017

Conversation

alysivji
Copy link
Contributor

Please let me know if you have any questions

@codecov
Copy link

codecov bot commented Dec 10, 2017

Codecov Report

Merging #18707 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.45% <100%> (+0.01%) ⬆️
#single 40.7% <16.66%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/datetimes.py 95.7% <100%> (+0.01%) ⬆️
pandas/core/indexes/base.py 96.44% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/util/testing.py 81.82% <0%> (-0.2%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/io/pytables.py 92.84% <0%> (ø) ⬆️
pandas/plotting/_converter.py 66.52% <0%> (+1.73%) ⬆️

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 1c1f507...ec05208. Read the comment docs.

@@ -994,9 +994,13 @@ def to_series(self, **kwargs):
"""

Copy link
Contributor

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.

@@ -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):
Copy link
Contributor

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

Copy link
Contributor

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

@@ -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`)
Copy link
Contributor

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`

Copy link
Contributor

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

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Dec 10, 2017
@alysivji
Copy link
Contributor Author

Completed requested changes and rebased.

@alysivji
Copy link
Contributor Author

@jreback Changes have been made. Anything else that needs to be done?

@jreback jreback added this to the 0.22.0 milestone Dec 13, 2017
@jreback jreback merged commit 54eaca8 into pandas-dev:master Dec 13, 2017
@jreback
Copy link
Contributor

jreback commented Dec 13, 2017

thanks!

@alysivji alysivji deleted the issue_18699 branch December 13, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Silently ignored kwargs in Index.to_series
2 participants