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
Merged

Fixes #4467 : Updates time_series for pandas deprecation #4530

merged 4 commits into from Mar 1, 2019

Conversation

@HSR05
Copy link
Contributor

@HSR05 HSR05 commented Feb 27, 2019

Changes pd.DatetimeIndex to pd.date_range

  • Tests added / passed
  • Passes flake8 dask

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

Changes pd.DatetimeIndex to pd.date_range
@HSR05
Copy link
Contributor Author

@HSR05 HSR05 commented Feb 27, 2019

ref : #4467

@mrocklin
Copy link
Member

@mrocklin mrocklin 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))
Copy link
Member

@TomAugspurger TomAugspurger Feb 27, 2019

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

@TomAugspurger
Copy link
Member

@TomAugspurger TomAugspurger 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
Copy link
Contributor Author

@HSR05 HSR05 commented Feb 27, 2019

@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,
@HSR05
Copy link
Contributor Author

@HSR05 HSR05 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,
Copy link
Member

@TomAugspurger TomAugspurger Feb 28, 2019

This should be pd.period_range.

Copy link
Contributor Author

@HSR05 HSR05 Feb 28, 2019

This should be pd.period_range.

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

@TomAugspurger
Copy link
Member

@TomAugspurger TomAugspurger 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
Copy link
Member

@mrocklin mrocklin 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
Copy link
Member

@TomAugspurger TomAugspurger commented Mar 1, 2019

馃憤

@TomAugspurger TomAugspurger merged commit de6d6c2 into dask:master Mar 1, 2019
1 of 2 checks passed
@TomAugspurger
Copy link
Member

@TomAugspurger TomAugspurger commented Mar 1, 2019

Thanks @HSR05!

@mrocklin
Copy link
Member

@mrocklin mrocklin 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 issue May 14, 2019
* 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants