-
Notifications
You must be signed in to change notification settings - Fork 600
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 initial support for ibis.random function #2060
Conversation
This PR fixes a couple of issues with the documentation CI build that I noticed over in #2060 which are related to the recent Pandas 1.0 release (see https://dev.azure.com/ibis-project/ibis/_build/results?bu ildId=1791&view=logs&j=8f09edc2-e3b7-52de-126a-0225c4f3efa1&t=78a72aec -b398-558e-7c0d-2d33604b9e53&l=129) Author: James Bourbeau <jrbourbeau@gmail.com> Closes #2061 from jrbourbeau/doc-fixup and squashes the following commits: 0f5f128 [James Bourbeau] Update release note to reflect new PR title cfcc962 [James Bourbeau] Add entry to release notes ba9c5ca [James Bourbeau] Explicilty set strict=False to override default in setup.cfg 3825b5b [James Bourbeau] Remove strict=True in xfail bb58b8a [James Bourbeau] xfail remaining test failures 2c385e5 [James Bourbeau] Add year param back to test_datatypes.py 939a6df [James Bourbeau] Update makeDataFrame location 3445ce3 [James Bourbeau] Some pandas 1.0 compat fixups
ibis/expr/api.py
Outdated
@@ -1344,6 +1345,11 @@ def clip(arg, lower=None, upper=None): | |||
return op.to_expr() | |||
|
|||
|
|||
def random(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create a ibis.expr.random; the goal is to produce a random scalar yes? reference the documentation https://docs.python.org/3/library/random.html, which i assume is the goal here.
ibis/expr/operations.py
Outdated
@@ -2450,6 +2450,11 @@ def output_type(self): | |||
return dt.timestamp.scalar_type() | |||
|
|||
|
|||
class Random(Constant): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be RandomScalar. you could eventually expand this to a column op as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrbourbeau do you still have any interesting on moving this forward? let me know if you need any help! thanks for having been working on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delayed response. I've made updates in response to @jreback's initial feedback, please let me know if there's anything else you'd like me to include in this PR
The |
@jrbourbeau the PR #2104 will fix this problem. |
I see, thanks for info! |
@jrbourbeau also would be good to have this new operation into the documentation. thanks for working on that! |
CI windows issues probably related to conda-forge/python-feedstock#325 |
Good to know, thanks for investigating. It's been a few hours since the fix was merged, would you mind restarting the CI build here to see if things are fixed? |
Sweet, thanks for the restart. Looks like the Windows CI failures have been resolved |
LinuxBuildConda should be fixed now. @jrbourbeau could you rebase your code on top of master pls? thanks! |
Thanks for the heads up @xmnlab! Just updated this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you merge master. looks good. ping on green.
cc @toryhaavik @icexelloss if you have comments. |
Thanks for taking a look @jreback. Merged |
thanks @jrbourbeau a followup could be to add this to the pandas back end (easy) |
This PR adds an
ibis.random
function which returns a random number between 0 (inclusive) and 1 (exclusive). I've started with initial support for the postgresql and mysql backendsCloses #1450