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

redshift: no default id being assigned #24545

Closed
Rizxcviii opened this issue Mar 9, 2023 · 4 comments · Fixed by #24546
Closed

redshift: no default id being assigned #24545

Rizxcviii opened this issue Mar 9, 2023 · 4 comments · Fixed by #24546
Labels
@aws-cdk/aws-redshift Related to Amazon Redshift bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@Rizxcviii
Copy link
Contributor

Rizxcviii commented Mar 9, 2023

Describe the bug

Upon the recent release, column ids were introduced, however the default value of the id is not set.
The id should be set to the name property, however this is not the case. The cdk diff does not show this.

Expected Behavior

Upon not setting an id in the Table construct.

[ ]   {
[ ]     "name": "col3",
[ ]     "dataType": "float",
[ ]     "comment": "A test column",
[-]     "encoding": "RAW"
[+]     "encoding": "RAW",
[+]     "id": "col3"
[ ]   }

Current Behavior

[ ]   {
[ ]     "name": "col3",
[ ]     "dataType": "float",
[ ]     "comment": "A test column",
[-]     "encoding": "RAW"
[+]     "encoding": "RAW",
[ ]   }

Reproduction Steps

Create a new table, without setting the id property of that table.

new redshift.Table(stack, 'Table', {
  ...databaseOptions,
  tableColumns: [
    { name: 'col1', dataType: 'varchar(4)' },
    { name: 'col2', dataType: 'float' },
    { name: 'col3', dataType: 'float' },
  ],
});

Possible Solution

Update the addColumnIds function to include the necessary functionality, which is a side effect to append on a column id if not present.

Additional Information/Context

This should have been implemented in the recent update, however this was overlooked.

CDK CLI Version

2.68.0

Framework Version

No response

Node.js Version

v16.16.0

OS

Amazon Linux 2

Language

Typescript, Python

Language Version

TypeScript (3.7.5) | 3.7.16

Other information

The PR that should have contained the fix is included here:
#24272

@Rizxcviii Rizxcviii added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 9, 2023
@github-actions github-actions bot added the @aws-cdk/aws-redshift Related to Amazon Redshift label Mar 9, 2023
@pahud pahud added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Mar 9, 2023
@pahud pahud self-assigned this Mar 9, 2023
@pahud pahud added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 9, 2023
@pahud
Copy link
Contributor

pahud commented Mar 9, 2023

Does this happen when creating a new table or updating an existing one without id column?

And, thank you for your PR!!

@pahud pahud removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-reproduction This issue needs reproduction. labels Mar 9, 2023
@pahud pahud removed their assignment Mar 9, 2023
@pahud pahud added p2 effort/medium Medium work item – several days of effort labels Mar 9, 2023
@Rizxcviii
Copy link
Contributor Author

Rizxcviii commented Mar 9, 2023

Does this happen when creating a new table or updating an existing one without id column?

And, thank you for your PR!!

@pahud This happens for both. Ids are not being appended on either tables. The feature was meant to default assign the id attribute on both existing and new tables, if no id was given by the developer

@pahud
Copy link
Contributor

pahud commented Mar 9, 2023

Thank you for the clarification @Rizxcviii . We'll be happy to review your PR when it's ready. Thanks.

@mergify mergify bot closed this as completed in #24546 Apr 12, 2023
mergify bot pushed a commit that referenced this issue Apr 12, 2023
The side effect to add the column ids, if not present, was not being performed. This functionality was supposed to be added, but was overlooked.

Closes #24545.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-redshift Related to Amazon Redshift bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants