Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): guide table naming on self-managed source setup (#68390)

Tom Owers9fb50c214961
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/components/SelfManagedSourceForm.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/components/SelfManagedSourceForm.tsx
index 7f7bb1d140d2..adee3386e9a7 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/components/SelfManagedSourceForm.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/components/SelfManagedSourceForm.tsx
@@ -81,7 +81,10 @@ export function SelfManagedSourceForm({ onUpdate }: Props): JSX.Element {
/>
)}
</LemonField>
- <div className="mb-4 text-xs text-secondary">This will be the table name used when writing queries</div>
+ <div className="mb-4 text-xs text-secondary">
+ This will be the table name used when writing queries. Use only letters, numbers, and underscores,
+ and start with a letter or underscore.
+ </div>
<LemonField name="url_pattern" label="Files URL pattern">
{({ value = '', onChange }) => (
<LemonInput
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/selfManagedSourceLogic.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/selfManagedSourceLogic.tsx
index 2953dd05b1e4..59ea52205c11 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/selfManagedSourceLogic.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/selfManagedSourceLogic.tsx
@@ -103,7 +103,9 @@ export const selfManagedSourceLogic = kea<selfManagedSourceLogicType>([
defaults: { ...NEW_WAREHOUSE_TABLE } as DataWarehouseTable,
errors: ({ name, url_pattern, credential, format }) => {
const HOGQL_TABLE_NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/
- if (!HOGQL_TABLE_NAME_REGEX.test(name)) {
+ // Let the empty-name case fall through to the friendlier "Please enter a name." below,
+ // rather than the naming-rules error which only makes sense once something's been typed.
+ if (name && !HOGQL_TABLE_NAME_REGEX.test(name)) {
return {
name: 'Invalid table name. Table names must start with a letter or underscore and contain only alphanumeric characters or underscores.',
}