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

fix(SchemaViewer): use partitioning keys order from HashColumns #1916

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Feb 6, 2025

Closes ydb-platform/ydb#14247

CI Results

Test Status: ❌ FAILED

πŸ“Š Full Report

Total Passed Failed Flaky Skipped
262 258 1 3 0

😟 No changes in tests. πŸ˜•

Bundle Size: βœ…

Current: 80.20 MB | Main: 80.20 MB
Diff: +0.81 KB (0.00%)

βœ… Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • πŸ“Š indicates links to detailed reports.
  • πŸ”Ί indicates increase, πŸ”½ decrease, and βœ… no change in bundle size.

@artemmufazalov artemmufazalov force-pushed the partitioning-keys-order branch from f8f630f to 09d7cf0 Compare February 6, 2025 12:57
Comment on lines +22 to +26
.filter((row): row is WithRequiredFields<SchemaData, 'keyColumnIndex' | 'name'> =>
Boolean(row.keyColumnIndex !== undefined && row.keyColumnIndex !== -1 && row.name),
)
.sort((column1, column2) => column1.keyColumnIndex - column2.keyColumnIndex)
.map((row) => row.name);
Copy link
Member Author

Choose a reason for hiding this comment

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

Update types to remove non-null assertions

Comment on lines +7 to +17
.filter((row): row is WithRequiredFields<SchemaData, 'partitioningColumnIndex' | 'name'> =>
Boolean(
row.partitioningColumnIndex !== undefined &&
row.partitioningColumnIndex !== -1 &&
row.name,
),
)
.sort(
(column1, column2) => column1.partitioningColumnIndex - column2.partitioningColumnIndex,
)
.map((row) => row.name);
Copy link
Member Author

Choose a reason for hiding this comment

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

Implemented sorting the same way as in getPrimaryKeys

Comment on lines +84 to +86
Indexes?: unknown;
Options?: TColumnTableSchemeOptions;
ColumnFamilies?: TFamilyDescription[];
Copy link
Member Author

@artemmufazalov artemmufazalov Feb 6, 2025

Choose a reason for hiding this comment

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

Updated types, set unknown to types, that are not used currently. The goal was to use backend response as is in tests without any TS errors

Comment on lines +244 to +248
it('returns empty array if data is undefined, empty or null', () => {
expect(prepareSchemaData(EPathType.EPathTypeTable, {})).toEqual([]);
expect(prepareSchemaData(EPathType.EPathTypeTable, undefined)).toEqual([]);
expect(prepareSchemaData(EPathType.EPathTypeTable, null)).toEqual([]);
});
Copy link
Member Author

Choose a reason for hiding this comment

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

There is no external tables in our dev clusters and there is no possibility to add them since feature flag is turned off and there is issue with flags. I didn't want to use generated response instead of real backend data, so I left external tables without tests for now

@artemmufazalov artemmufazalov marked this pull request as ready for review February 6, 2025 13:04
@astandrik astandrik requested a review from Copilot February 6, 2025 13:17

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/containers/Tenant/Schema/SchemaViewer/prepareData.ts: Evaluated as low risk
  • src/containers/Tenant/Schema/SchemaViewer/types.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/types/api/schema/columnEntity.ts:84

  • [nitpick] The use of 'unknown' for 'Indexes' might be too vague. Consider specifying a more concrete type if possible.
Indexes?: unknown;
@astandrik
Copy link
Collaborator

fixed this test Tenant diagnostics page is visible when describe returns no data

here https://github.com/ydb-platform/ydb-embedded-ui/pull/1902/files#diff-51e88559a0450975e50980de7e8beafe0dfbbc4dfbd8b86c08de6982e59d4781R14

@artemmufazalov artemmufazalov added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit fe3845c Feb 6, 2025
6 of 7 checks passed
@artemmufazalov artemmufazalov deleted the partitioning-keys-order branch February 6, 2025 14:02
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.

Partitioning keys do not preserve correct order (are sorted in UI)
2 participants