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

Ensure that primary and sequence keys cannot be the same #2106

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lajohn4747
Copy link
Contributor

resolves #2096
CU-86b11yb3u

Make sure _validate_key prevents primary_key from being the same as sequence_key

@lajohn4747 lajohn4747 requested a review from a team as a code owner July 3, 2024 15:38
@sdv-team
Copy link
Contributor

sdv-team commented Jul 3, 2024

Copy link
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment but otherwise LGTM!

sdv/metadata/single_table.py Outdated Show resolved Hide resolved
setting_primary_as_sequence = key_type == 'sequence' and column_name == self.primary_key
if setting_sequence_as_primary or setting_primary_as_sequence:
raise InvalidMetadataError(
f'The column ({column_name}) cannot be set as {key_type}_key as it is already set as the '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is 111 characters. Not sure why the linter isn't complaining

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsheni It seems to be because we are ignoring the line-to-long rule here

"E501",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added that rule back in and fixed the line length

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

Successfully merging this pull request may close these issues.

Primary key and sequential key cannot be the same
3 participants