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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4467 : Updates time_series for pandas deprecation #4530

Merged
merged 4 commits into from Mar 1, 2019

Conversation

Projects
None yet
3 participants
@HSR05
Copy link
Contributor

commented Feb 27, 2019

Changes pd.DatetimeIndex to pd.date_range

  • Tests added / passed
  • Passes flake8 dask

cc : @mrocklin please review the PR.
Cheers 馃憤

Fixes #4467 : Updates time_series for pandas deprecation
Changes pd.DatetimeIndex to pd.date_range
@HSR05

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

ref : #4467

@mrocklin

This comment has been minimized.

Copy link
Member

commented Feb 27, 2019

@@ -87,7 +87,7 @@ def make_timeseries(start='2000-01-01',
2000-01-01 06:00:00 960 Charlie 0.788245
2000-01-01 08:00:00 1031 Kevin 0.466002
"""
divisions = list(pd.DatetimeIndex(start=start, end=end,
divisions = list(pd.date_range(start=start, end=end,
freq=partition_freq))

This comment has been minimized.

Copy link
@TomAugspurger

TomAugspurger Feb 27, 2019

Member

This line may fail this linter. Need to decent it a bit.

@TomAugspurger

This comment has been minimized.

Copy link
Member

commented Feb 27, 2019

I see a few more uses of the deprecated pandas behavior throughout dask. Do you mind updating those while you're at it?

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,
@HSR05

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

@TomAugspurger yeah sure. I'll look into those and update it asap. 馃憤

Changes
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,
@HSR05

This comment has been minimized.

Copy link
Contributor Author

commented Feb 28, 2019

@TomAugspurger updated the deprecated pandas behavior throughout dask.
Please review the PR.

Cheers 馃憤

@@ -390,7 +390,7 @@ def _nonempty_index(idx):
return pd.DatetimeIndex(data, start=start, periods=2, freq=idx.freq,
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,

This comment has been minimized.

Copy link
@TomAugspurger

TomAugspurger Feb 28, 2019

Member

This should be pd.period_range.

This comment has been minimized.

Copy link
@HSR05

HSR05 Feb 28, 2019

Author Contributor

This should be pd.period_range.

My bad. Thanks for the review.
Updated it. @TomAugspurger

@TomAugspurger

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

Some linting errors: https://travis-ci.org/dask/dask/jobs/499881647#L2092

you can run flake8 locally on those files to verify.

@mrocklin

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

I've pushed flake8 fixes. The current failure is unrelated, and being handled in #4537

@TomAugspurger is everything else here good to be merged?

@TomAugspurger

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

馃憤

@TomAugspurger TomAugspurger merged commit de6d6c2 into dask:master Mar 1, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@TomAugspurger

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

Thanks @HSR05!

@mrocklin

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

Thanks @HSR05 !

Also, I notice that this is your first code contribution to this repository. Welcome!

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

Fixes dask#4467 : Updates time_series for pandas deprecation (dask#4530)
* Fixes dask#4467 : Updates time_series for pandas deprecation

Changes pd.DatetimeIndex to pd.date_range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.