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

Refactor groupby behavior, add agg function to Checks, support error callback option #488

Open
3 tasks
cosmicBboy opened this issue May 8, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@cosmicBboy
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

This issue tackles several problems with the related theme of producing more informative error messages in Checks, see discussion in #429.

Describe the solution you'd like

The outcome of the discussion is described in #429 (comment)

  • refactor groupby behavior to expect a pandas Groupby object (breaking change)
  • add agg kwarg to Check that simply wraps DataFrame.agg and Series.agg depending on the schema context
  • support callback function for the error kwarg:
CheckObj = Union[pd.Series, pd.DataFrame, pd.Groupby]  # series or dataframe can be the output of `agg` operation

def error_callback(check_obj: CheckObj, check_output) -> str:
    return f"check failed with values {check_obj}, check output: {check_output}"
@cmhac
Copy link

cmhac commented Sep 25, 2023

What's the status of this? I'm running into a use case where I need the exact functionality described in #872.

I'm currently just raising an error in the check if it fails to help debug, but would love to have this be part of the tool.

@cosmicBboy
Copy link
Collaborator Author

hi @christopher-hacker this is ready to be worked on, no one is currently owning this. Would you be interested in making a contribution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants