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

Add min periods parameter to Window #1792

Merged
merged 7 commits into from
May 24, 2019
Merged

Conversation

emilyreff7
Copy link
Contributor

We want to set min_periods=1 on rolling windows to avoid defaulting to min_periods equal to the window size n, thereby eliminating the necessity of NaNs in the first n-1 rows for trailing window operations.

@cpcloud cpcloud added this to the 1.1.0 milestone May 23, 2019
@cpcloud cpcloud self-requested a review May 23, 2019 16:25
@cpcloud cpcloud added feature Features or general enhancements pandas The pandas backend window functions Issues or PRs related to window functions labels May 23, 2019
@cpcloud
Copy link
Member

cpcloud commented May 23, 2019

@emilyreff7 It looks like you have a lint error: https://circleci.com/gh/ibis-project/ibis/7540?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

I'm going to looking into adding pep8speaks to ibis so that these kinds of failures are immediately surfaced rather than having to hunt through CI.

You can also see these failures on the command line by running make lint.

@cpcloud
Copy link
Member

cpcloud commented May 23, 2019

@emilyreff7 Another thing that will prevent lint issues in a PR is to setup the commit hooks using pre-commit. Once you've created your environment you can run pip install pre-commit and then inside your ibis clone run pre-commit install. Then when you run git commit the lint and style checks will run and will prevent committing unless they pass.

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple of comments.

ibis/pandas/tests/test_udf.py Outdated Show resolved Hide resolved
ibis/pandas/aggcontext.py Outdated Show resolved Hide resolved
@emilyreff7
Copy link
Contributor Author

@emilyreff7 Another thing that will prevent lint issues in a PR is to setup the commit hooks using pre-commit. Once you've created your environment you can run pip install pre-commit and then inside your ibis clone run pre-commit install. Then when you run git commit the lint and style checks will run and will prevent committing unless they pass.

I ran the above but got an error once I got to the git commit step:

Errors:
Traceback (most recent call last):
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 2580, in
main()
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 831, in main
symlink=options.symlink,
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 1123, in create_environment
install_wheel(to_install, py_executable, search_dirs, download=download)
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 973, in install_wheel
_install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 1060, in _install_wheel_with_search_dir
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
File "/home/emily/anaconda3/envs/ibis-dev/lib/python3.6/site-packages/virtualenv.py", line 924, in call_subprocess
raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /home/emily/.cache/p...hon3.6/bin/python3.6 - setuptools pip wheel failed with error code 2

I re-installed pre-commit using conda (conta install -c conda-forge pre_commit) and it resolved the issue.

Also now just waiting on the checks to run...have been running/queued up for 1+ hours now.

@cpcloud
Copy link
Member

cpcloud commented May 24, 2019

@emilyreff7 Sometimes the checks take awhile if you haven't enabled the CI services on your fork. If you enable CircleCI and Azure Pipelines on your fork then the CI will run with a separate set of containers than the ones that are used to run CI for the ibis-project user. I can help you set that up if you want.

@cpcloud
Copy link
Member

cpcloud commented May 24, 2019

In any event, this LGTM.

@cpcloud cpcloud merged commit d619ca8 into ibis-project:master May 24, 2019
@emilyreff7 emilyreff7 deleted the rolling branch May 24, 2019 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements pandas The pandas backend window functions Issues or PRs related to window functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants