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

UDF signature update & Python data types #1307

Merged
merged 6 commits into from
Jul 18, 2023
Merged

Conversation

richard-rogers
Copy link
Contributor

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-matching ResolverSpecs to use Python types rather than whylogs DataType.

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 and ResolverSpec matching by type can now use native Python types via a TypeMapper in addition to the whylogs DataType

  • I have reviewed the Guidelines for Contributing and the Code of Conduct.

Copy link
Contributor

@FelipeAdachi FelipeAdachi left a 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.

Copy link
Contributor

@jamie256 jamie256 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jamie256 jamie256 merged commit 3dfb921 into mainline Jul 18, 2023
19 checks passed
@jamie256 jamie256 deleted the dev/richard/udfsig branch July 18, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants