feat(glue): typed partition projection#35660
Conversation
c5549de to
bd686fd
Compare
describe('DateIntervalUnit', () => {
test('has correct enum values', () => {
expect(glue.DateIntervalUnit.YEARS).toBe('YEARS');
expect(glue.DateIntervalUnit.MONTHS).toBe('MONTHS');
expect(glue.DateIntervalUnit.WEEKS).toBe('WEEKS');
expect(glue.DateIntervalUnit.DAYS).toBe('DAYS');
expect(glue.DateIntervalUnit.HOURS).toBe('HOURS');
expect(glue.DateIntervalUnit.MINUTES).toBe('MINUTES');
expect(glue.DateIntervalUnit.SECONDS).toBe('SECONDS');
});
test('has all 7 interval units', () => {
const values = Object.values(glue.DateIntervalUnit);
expect(values).toHaveLength(7);
expect(values).toContain('YEARS');
expect(values).toContain('MONTHS');
expect(values).toContain('WEEKS');
expect(values).toContain('DAYS');
expect(values).toContain('HOURS');
expect(values).toContain('MINUTES');
expect(values).toContain('SECONDS');
});
}); |
|
Thanks for working on this @badmintoncryer ! |
|
@vishaalmehrishi Thank you for your review!! I've addressed all of your comments. |
…n projection values
Pull request has been modified.
|
@vishaalmehrishi Could you please confirm again? |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status✅ The pull request has been merged at 3c04683 This pull request spent 33 minutes 1 second in the queue, including 32 minutes 51 seconds running CI. Required conditions to merge
|
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #35428.
Reason for this change
AWS Glue partition projection configuration was not type-safe, making it prone to runtime errors.
Specifically:
Description of changes
Refactored partition projection configuration to use a type-safe factory method pattern:
1. Factory Methods
PartitionProjectionConfiguration.integer()- INTEGER type projectionPartitionProjectionConfiguration.date()- DATE type projectionPartitionProjectionConfiguration.enum()- ENUM type projectionPartitionProjectionConfiguration.injected()- INJECTED type projectionEach factory method has a dedicated Props interface, with TypeScript's type system enforcing required
properties.
Describe any new or updated permissions being added
None
Description of how you validated changes
Add both unit and integ tests.
Checklist
and DESIGN GUIDELINES
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0
license