Fixes #4467 : Updates time_series for pandas deprecation#4530
Fixes #4467 : Updates time_series for pandas deprecation#4530TomAugspurger merged 4 commits intodask:masterfrom HSR05:hsr05-patch
Conversation
Changes pd.DatetimeIndex to pd.date_range
|
ref : #4467 |
|
cc @TomAugspurger or @jrbourbeau in case you have time to review
…On Wed, Feb 27, 2019 at 10:41 AM HSR05 ***@***.***> wrote:
ref : #4467 <#4467>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4530 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszP72pKYGFJvIvXs0TfCeoj29Q2lyks5vRtFQgaJpZM4bVMZ2>
.
|
dask/dataframe/io/demo.py
Outdated
| """ | ||
| divisions = list(pd.DatetimeIndex(start=start, end=end, | ||
| divisions = list(pd.date_range(start=start, end=end, | ||
| freq=partition_freq)) |
There was a problem hiding this comment.
This line may fail this linter. Need to decent it a bit.
|
I see a few more uses of the deprecated pandas behavior throughout dask. Do you mind updating those while you're at it? |
|
@TomAugspurger yeah sure. I'll look into those and update it asap. 👍 |
dask/dataframe/io/tests/test_demo.py 21: assert df.divisions == tuple(pd.DatetimeIndex(start='2000', end='2015', dask/dataframe/io/demo.py 45: index = pd.DatetimeIndex(start=start, end=end, freq=freq, name='timestamp') 90: divisions = list(pd.DatetimeIndex(start=start, end=end, dask/dataframe/tests/test_dataframe.py 1393: ind = pd.DatetimeIndex(start=start, end=end, freq='60s') dask/dataframe/core.py 4296: divisions = pd.DatetimeIndex(start=start, dask/dataframe/utils.py 393: return pd.PeriodIndex(start='1970-01-01', periods=2, freq=idx.freq,
|
@TomAugspurger updated the deprecated pandas behavior throughout dask. Cheers 👍 |
dask/dataframe/utils.py
Outdated
| tz=idx.tz, name=idx.name) | ||
| elif typ is pd.PeriodIndex: | ||
| return pd.PeriodIndex(start='1970-01-01', periods=2, freq=idx.freq, | ||
| return pd.date_range(start='1970-01-01', periods=2, freq=idx.freq, |
There was a problem hiding this comment.
This should be pd.period_range.
There was a problem hiding this comment.
This should be
pd.period_range.
My bad. Thanks for the review.
Updated it. @TomAugspurger
|
Some linting errors: https://travis-ci.org/dask/dask/jobs/499881647#L2092 you can run |
|
I've pushed flake8 fixes. The current failure is unrelated, and being handled in #4537 @TomAugspurger is everything else here good to be merged? |
|
👍 |
|
Thanks @HSR05! |
|
Thanks @HSR05 ! Also, I notice that this is your first code contribution to this repository. Welcome! |
Changes pd.DatetimeIndex to pd.date_range
flake8 daskcc : @mrocklin please review the PR.
Cheers 👍