-
Notifications
You must be signed in to change notification settings - Fork 118
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
UDF signature update & Python data types #1307
Conversation
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.
I didn't take a deep look into the code itself, but tested the branch out with some scenarios on both rows and dfs, and didn't hit into any errors.
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.
LGTM!
Description
Changes dataset and type UDF signatures so that they can be coded to ignore whether they're called with a row or
DataFrame
. Also allows type-matchingResolverSpec
s to use Python types rather than whylogsDataType
.Changes
Dataset UDF signature is
udf(x: Union[Dict[str, List], pd.DataFrame]) -> Union[List, pd.Series]
Type UDF signature is
udf(x: Union[List, pd.Series]) -> Union[List, pd.Series]
UNCHANGED: metric UDF signature remains
udf(x: Any) -> Any
, where the Anys are single values in a row.UdfSpec
andResolverSpec
matching by type can now use native Python types via aTypeMapper
in addition to the whylogsDataType
I have reviewed the Guidelines for Contributing and the Code of Conduct.