diff --git a/.changeset/eight-foxes-bathe.md b/.changeset/eight-foxes-bathe.md new file mode 100644 index 0000000000..78fa03d863 --- /dev/null +++ b/.changeset/eight-foxes-bathe.md @@ -0,0 +1,6 @@ +--- +'@finos/legend-graph': patch +--- + + +Use `csv_transformed` for csv serialization with engine to leverage correct handling of enums and timestamps in results. \ No newline at end of file diff --git a/packages/legend-graph/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts b/packages/legend-graph/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts index 520b35871d..d637179971 100644 --- a/packages/legend-graph/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts +++ b/packages/legend-graph/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts @@ -43,7 +43,7 @@ import type { V1_LightQuery, V1_Query } from './query/V1_Query.js'; import type { V1_ServiceStorage } from './service/V1_ServiceStorage.js'; import type { GenerationMode } from '../../../../../graph-manager/action/generation/GenerationConfigurationDescription.js'; import type { V1_QuerySearchSpecification } from './query/V1_QuerySearchSpecification.js'; -import type { EXECUTION_SERIALIZATION_FORMAT } from '../../../../../graph-manager/action/execution/ExecutionResult.js'; +import { EXECUTION_SERIALIZATION_FORMAT } from '../../../../../graph-manager/action/execution/ExecutionResult.js'; import type { V1_ExternalFormatDescription } from './externalFormat/V1_ExternalFormatDescription.js'; import type { V1_ExternalFormatModelGenerationInput } from './externalFormat/V1_ExternalFormatModelGeneration.js'; import type { V1_GenerateSchemaInput } from './externalFormat/V1_GenerateSchemaInput.js'; @@ -141,6 +141,21 @@ export type V1_GrammarParserBatchInputEntry = { | undefined; }; +enum ENGINE_EXECUTION_SERIALIZATION_FORMAT { + CSV_TRANSFORMED = 'csv_transformed', +} + +const getEngineSerializationFormat = ( + val: EXECUTION_SERIALIZATION_FORMAT, +): ENGINE_EXECUTION_SERIALIZATION_FORMAT | string => { + switch (val) { + case EXECUTION_SERIALIZATION_FORMAT.CSV: + return ENGINE_EXECUTION_SERIALIZATION_FORMAT.CSV_TRANSFORMED; + default: + return val; + } +}; + export class V1_EngineServerClient extends AbstractServerClient { currentUserId?: string | undefined; private env?: string | undefined; @@ -603,7 +618,9 @@ export class V1_EngineServerClient extends AbstractServerClient { {}, undefined, { - serializationFormat: options?.serializationFormat, + serializationFormat: options?.serializationFormat + ? getEngineSerializationFormat(options.serializationFormat) + : undefined, }, { enableCompression: true }, { skipProcessing: Boolean(options?.returnResultAsText) },