SDV
SDV copied to clipboard
Separate primary key detection functionality
Problem Description
As a user, I'd like to be able to detect a subset of the metadata based on my needs. For example, I may only want to detect sdtypes, or only detect primary keys.
Expected behavior
We want to split out the functionality for detecting the primary key so that it can be called in its own function.
Acceptance criteria
- There should be a private function
_detect_primary_key(self, data)
that will return the guessed primary key
Additional context
- Currently, our logic for primary key detection is wrapped up in sdtype detection. All of this logic happens in the _detect_columns function. We originally did these together to be more efficient since we already looped over all the columns to determine the sdtype and could figure out if a column was a primary key candidate at the same time. Now we should separate this so that it is more modular and also since we may change the logic to determine the primary key anyway.