Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Here are the current supported functionalities of Checks.
| | areAnyComplete(columns) | Done |
| | haveAnyCompleteness(columns, assertion) | Done |
| | isUnique(column) | Done |
| | isPrimaryKey(column, *columns) | Not Implemented |
| | isPrimaryKey(column, *columns) | Done |
| | hasUniqueness(columns, assertion) | Done |
| | hasDistinctness(columns, assertion) | Done |
| | hasUniqueValueRatio(columns, assertion) | Done |
Expand Down
16 changes: 8 additions & 8 deletions pydeequ/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,21 @@ def isUnique(self, column, hint=None):
self._Check = self._Check.isUnique(column, hint, self._jvm.scala.Option.apply(None))
return self

def isPrimaryKey(self, column, *columns, hint=None):
def isPrimaryKey(self, column, *columns):
"""
Creates a constraint that asserts on a column(s) primary key characteristics.
Currently only checks uniqueness, but reserved for primary key checks if there is another
assertion to run on primary key columns.

# how does column and columns differ
:param str column: Column in Data Frame to run the assertion on.
:param str hint: A hint that states why a constraint could have failed.
:param list[str] columns: Columns to run the assertion on.
Uniqueness is checked for the list of all columns: [column] + columns.

:param str column: The 1st column in Data Frame to run the assertion on.
:param list[str] columns: Additional columns to run the assertion on.
:return: isPrimaryKey self: A Check.scala object that asserts completion in the columns.
"""
hint = self._jvm.scala.Option.apply(hint)
print(f"Unsolved integration: {hint}")
raise NotImplementedError("Unsolved integration of Python tuple => varArgs")
columns_seq = to_scala_seq(self._jvm, columns)
self._Check = self._Check.isPrimaryKey(column, columns_seq)
return self

def hasUniqueness(self, columns, assertion, hint=None):
"""
Expand Down
Loading