This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 32fdda6b4b TINKERPOP-3204 Extract type-discovery 'unknown' into a
constant
32fdda6b4b is described below
commit 32fdda6b4b20dc99c6121293c6a1c21cd6a6f66a
Author: Stephen Mallette <[email protected]>
AuthorDate: Tue Jun 16 19:22:39 2026 -0400
TINKERPOP-3204 Extract type-discovery 'unknown' into a constant
Replace the repeated 'unknown' string literal in property-analyzer.ts with
a PROPERTY_TYPES.UNKNOWN constant in constants.ts. Internal change only.
Assisted-by: Claude Code:claude-opus-4-8
---
gremlin-js/gremlin-mcp/src/constants.ts | 6 ++++++
gremlin-js/gremlin-mcp/src/gremlin/property-analyzer.ts | 7 ++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gremlin-js/gremlin-mcp/src/constants.ts
b/gremlin-js/gremlin-mcp/src/constants.ts
index e37b33cf99..ecb1282b69 100644
--- a/gremlin-js/gremlin-mcp/src/constants.ts
+++ b/gremlin-js/gremlin-mcp/src/constants.ts
@@ -65,3 +65,9 @@ export const MIME_TYPES = {
TEXT_PLAIN: 'text/plain',
APPLICATION_JSON: 'application/json',
} as const;
+
+// Property Analysis
+export const PROPERTY_TYPES = {
+ // Sentinel used when a property's type cannot be determined from sample
values.
+ UNKNOWN: 'unknown',
+} as const;
diff --git a/gremlin-js/gremlin-mcp/src/gremlin/property-analyzer.ts
b/gremlin-js/gremlin-mcp/src/gremlin/property-analyzer.ts
index 0f0fa626d0..1663430183 100644
--- a/gremlin-js/gremlin-mcp/src/gremlin/property-analyzer.ts
+++ b/gremlin-js/gremlin-mcp/src/gremlin/property-analyzer.ts
@@ -29,6 +29,7 @@ import type { Property } from './models/index.js';
import type { GraphTraversalSource, SchemaConfig } from './types.js';
import { getSamplePropertyValues, processBatched } from './query-utils.js';
import type { GremlinQueryError } from '../errors.js';
+import { PROPERTY_TYPES } from '../constants.js';
/**
* Analyzes property characteristics from collected values.
@@ -47,7 +48,7 @@ export const analyzePropertyFromValues = (
if (config.enumPropertyDenyList.includes(propertyKey)) {
return {
name: propertyKey,
- type: ['unknown'],
+ type: [PROPERTY_TYPES.UNKNOWN],
};
}
@@ -59,7 +60,7 @@ export const analyzePropertyFromValues = (
const property: Property = {
name: propertyKey,
- type: types.length > 0 ? types : ['unknown'],
+ type: types.length > 0 ? types : [PROPERTY_TYPES.UNKNOWN],
};
// Add sample values if requested
@@ -98,7 +99,7 @@ export const analyzeSingleProperty = (
if (config.enumPropertyDenyList.includes(propertyKey)) {
return {
name: propertyKey,
- type: ['unknown'],
+ type: [PROPERTY_TYPES.UNKNOWN],
};
}