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 has_min, has_max, has_mean #32

Open
7 tasks
SemyonSinchenko opened this issue Sep 23, 2024 · 2 comments
Open
7 tasks

Add has_min, has_max, has_mean #32

SemyonSinchenko opened this issue Sep 23, 2024 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed python-client

Comments

@SemyonSinchenko
Copy link
Collaborator

An object CheckBuilder provides a syntax sugar on top of ConstraintBuilder. But at the moment only a limited amount of possible cases are covered. The goal is to implement:

  • has_min
  • has_max
  • has_mean
  • has_std
  • has_max_len
  • has_min_len
  • contains_pattern

As an example existing syntax sugar can be used:

def has_uniqueness(
    self,
    columns: list[str],
    expected_value: float,
    hint: str = "",
    name: str | None = None,
    where: str | None = None,
    options: AnalyzerOptions | None = None,
) -> Self:
    """Create a constraint that the given set of columns have an expected level of uniqueness."""
    return self.with_constraint(
        ConstraintBuilder()
        .for_analyzer(
            Uniqueness(
                columns=columns,
                where=where,
                options=options or AnalyzerOptions.default(),
            )
        )
        .with_name(name or f"Uniquesness{','.join(columns)}")
        .with_hint(hint)
        .should_be_eq_to(expected_value)
        .build()
    )

So, instead of directly calling a constraint builder users are able to cal a single method of the check builder.

@SemyonSinchenko SemyonSinchenko added help wanted Extra attention is needed good first issue Good for newcomers python-client labels Sep 23, 2024
@iLOVEcodingAHHHHHH
Copy link

iLOVEcodingAHHHHHH commented Sep 23, 2024

Hello, this will literally be my first python issue if I'm able to contribute. I have a firm background working with statistical data, I was an Excel professional for about 5 years but my programming background is less impressive. I've spent about a year studying python and am eager to get my hands dirty. The summary stats listed in the issue description immediately jumped out at me but as a new git user and somewhat beginner to python I'd need some guidance. Would it make sense for me to review, run, and play with data-morph a bit? What is a good starting point?

@SemyonSinchenko
Copy link
Collaborator Author

@iLOVEcodingAHHHHHH Hello! Thank you for the interest to the project. The first thing I would recommend you to do is to read something about how git works. What you need to do is to fork the project, after that clone the forked project to your local machine, do required changes, push to your fork and after open a pull-request to the upstream. There is a small interactive course about git: https://learngitbranching.js.org/ (or you can try to watch videos on YouTube).

About required changes.
For example, at the moment adding a has_min constraint for user means manually create a constraint with builder like described in the issue. The idea is to provide instead simple methods for popular cases that allows to add such a constraint without calling builder.

Feel free to ping me, if you have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed python-client
Projects
None yet
Development

No branches or pull requests

2 participants