awslabs / python-deequ

Python API for Deequ
Apache License 2.0
691 stars 132 forks source link

Documentation doesn't match method implementation. #29

Closed rwagenmaker closed 3 years ago

rwagenmaker commented 3 years ago

The documentation says the function receives "hint" as a parameter, but it doesnt. : https://github.com/awslabs/python-deequ/blob/522f9bfb3bec994ab77a37788409ab35153810d0/pydeequ/checks.py#L736

def isContainedIn(self, column, allowed_values):
        """
        Asserts that every non-null value in a column is contained in a set of predefined values

        :param str column: Column in DataFrame to run the assertion on.
        :param list[str] allowed_values: A function that accepts allowed values for the column.
        :param str hint: A hint that states why a constraint could have failed.
        :return: isContainedIn self: A Check object that runs the assertion on the columns.
        """
        arr = self._spark_session.sparkContext._gateway.new_array(self._jvm.java.lang.String, len(allowed_values))
        for i in range(0, len(allowed_values)):
            arr[i] = allowed_values[i]
        self._Check = self._Check.isContainedIn(column, arr)
        return self

Of course the easy way is to remove the parameter from the docstring, but I would actually like to define a hint for my constraint.

gucciwang commented 3 years ago

Fixed with PyDeequ-0.1.7!