Skip to content

fix: DH-17599: Fix table name validation - allow hyphens#2398

Merged
vbabich merged 2 commits intodeephaven:mainfrom
vbabich:fix_tablename_validation
Mar 31, 2025
Merged

fix: DH-17599: Fix table name validation - allow hyphens#2398
vbabich merged 2 commits intodeephaven:mainfrom
vbabich:fix_tablename_validation

Conversation

@vbabich
Copy link
Copy Markdown
Collaborator

@vbabich vbabich commented Mar 28, 2025

  • Updated STERILE_TABLE_AND_NAMESPACE_REGEX in DbNameValidator to match the Java class and allow hyphens in table names
  • Added replace arg to DbNameValidator.legalize to preserve the existing legalizeColumnName behavior - replace spaces and hyphens in column names with underscores.
  • Updated unit tests

@vbabich vbabich self-assigned this Mar 28, 2025
@vbabich vbabich requested review from a team, Copilot and dgodinez-dh and removed request for a team March 28, 2025 16:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@vbabich vbabich enabled auto-merge (squash) March 28, 2025 16:27
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.83%. Comparing base (99dfcab) to head (ad4a328).
Report is 4 commits behind head on main.

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           
Flag Coverage Δ
unit 46.83% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vbabich vbabich requested review from a team, dgodinez-dh and mofojed and removed request for a team and dgodinez-dh March 28, 2025 17:36
@vbabich vbabich merged commit 4b1c9dd into deephaven:main Mar 31, 2025
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2025
@vbabich vbabich deleted the fix_tablename_validation branch March 31, 2025 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants