fix: DH-17599: Fix table name validation - allow hyphens#2398
Merged
vbabich merged 2 commits intodeephaven:mainfrom Mar 31, 2025
Merged
fix: DH-17599: Fix table name validation - allow hyphens#2398vbabich merged 2 commits intodeephaven:mainfrom
vbabich merged 2 commits intodeephaven:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes table name validation by allowing hyphens in table names and preserves the existing behavior for column names by replacing spaces and hyphens with underscores. It also updates the associated unit tests accordingly.
- Updated the regex for table names in DbNameValidator.ts to allow hyphens.
- Added dedicated replacer functions for table and column names.
- Adjusted unit tests in DbNameValidator.test.ts to reflect the new behavior.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/utils/src/DbNameValidator.ts | Updated regex to allow hyphens and added replacer functions. |
| packages/utils/src/DbNameValidator.test.ts | Modified test cases to account for the new behavior in naming. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2398 +/- ##
=======================================
Coverage 46.82% 46.83%
=======================================
Files 711 711
Lines 39289 39299 +10
Branches 10007 10010 +3
=======================================
+ Hits 18398 18404 +6
- Misses 20837 20841 +4
Partials 54 54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dgodinez-dh
approved these changes
Mar 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STERILE_TABLE_AND_NAMESPACE_REGEXinDbNameValidatorto match the Java class and allow hyphens in table namesreplacearg toDbNameValidator.legalizeto preserve the existinglegalizeColumnNamebehavior - replace spaces and hyphens in column names with underscores.