: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(batch-exports): use standard `.parquet` extension for new exports (#102223)
Ross1daba86e31b0
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex b9ed8a7980f8..c624c1f6a270 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7048,6 +7048,10 @@ snapshots:hash: v1.k794b7964.225c993f2a01b2b7740a519f2e7aa4d672c2e36aaf0938d770ecf5e893adf96b.q5tkLTRzuzGhGj8QUAT2pNhJSte7YCW4wengZTGYw3Mscenes-app-batchexports--backfills-with-estimates--light:hash: v1.k794b7964.bdb71e856369ccdaacaf893d0e9427b9bfeb6513333c4af98ca37cb9fb687896.kQuW_-2hLUIZa0vOFnn_FuNuy3d7ALzGXm5P7zamdVc+ scenes-app-batchexports--existing-aws-s-3-export-with-legacy-parquet-extension--dark:+ hash: v1.k794b7964.7fdfa490dcc0c090eaef0d5af01c499967eafb9a97ce220b98d26dbb46c01239.-IZXjJ0KvKGGlCoT8oNMDj7RS9wPwvUS7nBgBFMUvs8+ scenes-app-batchexports--existing-aws-s-3-export-with-legacy-parquet-extension--light:+ hash: v1.k794b7964.f91575942a28d9009dcb75df44bf5e0d3ccb7b8fabe53b5a69d8bacb94121548.DvrIRXFa2_Bq5-aBrq-g3p8JmFdVPlU2A6Fco3hJZMwscenes-app-batchexports--existing-big-query-export--dark:hash: v1.k794b7964.158bb2510d66c6fe81f144c86fd612bac8c95cc95f56186e4465e8995a1e38b8.YJ_6q5QuNZQJsomF5fYIADEUdgz670SCVgfQtUCRL6Yscenes-app-batchexports--existing-big-query-export--light:diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsxindex 6224c508b81b..053873dfc8c1 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx@@ -373,6 +373,7 @@ export function BatchExportConfiguration(): JSX.Element {<BatchExportConfigurationFieldsisNew={isNew}formValues={configuration as BatchExportConfigurationForm}+ savedConfig={batchExportConfig?.destination?.config ?? null}selectedIntegration={selectedIntegration}/></div>@@ -400,10 +401,12 @@ export function BatchExportConfiguration(): JSX.Element {function BatchExportConfigurationFields({isNew,formValues,+ savedConfig,selectedIntegration,}: {isNew: booleanformValues: BatchExportConfigurationForm+ savedConfig: Record<string, any> | nullselectedIntegration: IntegrationType | null}): JSX.Element {return (@@ -412,6 +415,7 @@ function BatchExportConfigurationFields({<BatchExportsEditFieldsisNew={isNew}batchExportConfigForm={formValues}+ savedConfig={savedConfig}selectedIntegration={selectedIntegration}/></>diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportEditForm.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportEditForm.tsxindex cbaee58553c6..f7a9247c02c3 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportEditForm.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportEditForm.tsx@@ -84,10 +84,12 @@ export function BatchExportGeneralEditFields({export function BatchExportsEditFields({isNew,batchExportConfigForm,+ savedConfig,selectedIntegration,}: {isNew: booleanbatchExportConfigForm: BatchExportConfigurationForm+ savedConfig?: Record<string, any> | nullselectedIntegration?: IntegrationType | null}): JSX.Element {const destination = batchExportConfigForm.destination@@ -99,6 +101,7 @@ export function BatchExportsEditFields({<definition.FieldsisNew={isNew}formValues={batchExportConfigForm}+ savedConfig={savedConfig}selectedIntegration={selectedIntegration}/>)}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsxindex 748cae1e2ab5..ebb9389e20b8 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx@@ -15,6 +15,20 @@ const EXISTING_EXPORT = {filters: [],}+const EXISTING_LEGACY_S3_PARQUET_EXPORT = {+ ...batchExports.results[2],+ id: '018a6fab-2c21-0001-d451-724c2995e2c1',+ model: 'events',+ filters: [],+ destination: {+ ...batchExports.results[2].destination,+ config: {+ ...batchExports.results[2].destination.config,+ file_format: 'Parquet',+ },+ },+}+const meta: Meta = {component: App,title: 'Scenes-App/BatchExports',@@ -31,6 +45,14 @@ const meta: Meta = {'/api/environments/:team_id/batch_exports/test/': { steps: [] },[`/api/environments/:team_id/batch_exports/${EXISTING_EXPORT.id}/runs/`]: { results: [] },[`/api/environments/:team_id/batch_exports/${EXISTING_EXPORT.id}/backfills/`]: { results: [] },+ [`/api/environments/:team_id/batch_exports/${EXISTING_LEGACY_S3_PARQUET_EXPORT.id}/`]:+ EXISTING_LEGACY_S3_PARQUET_EXPORT,+ [`/api/environments/:team_id/batch_exports/${EXISTING_LEGACY_S3_PARQUET_EXPORT.id}/runs/`]: {+ results: [],+ },+ [`/api/environments/:team_id/batch_exports/${EXISTING_LEGACY_S3_PARQUET_EXPORT.id}/backfills/`]: {+ results: [],+ },// Integration-backed destinations (Databricks, AzureBlob, BigQuery) render IntegrationChoice.'/api/projects/:team_id/integrations': { results: [] },},@@ -105,6 +127,12 @@ export const ExistingBigQueryExport: Story = {},}+export const ExistingAwsS3ExportWithLegacyParquetExtension: Story = {+ parameters: {+ pageUrl: urls.batchExport(EXISTING_LEGACY_S3_PARQUET_EXPORT.id),+ },+}+const MOCK_BACKFILLS: RawBatchExportBackfill[] = [{id: 'backfill-001',diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.tsindex f7c8c1fd1f34..f4e6e505bd35 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts@@ -71,6 +71,12 @@ const AWS_S3_GZIP_BATCH_EXPORT = fixture('test-aws-s3-gzip-id', 'AWS S3 gzip Expconfig: { ...AWS_S3_CONFIG, compression: 'gzip' },})+const AWS_S3_LEGACY_EXTENSION_BATCH_EXPORT = fixture('test-aws-s3-legacy-ext-id', 'AWS S3 legacy extension Export', {+ type: 'AwsS3',+ integration: 31,+ config: { ...AWS_S3_CONFIG, legacy_parquet_extension: true },+})+const S3_COMPATIBLE_BATCH_EXPORT = fixture('test-s3-compatible-id', 'S3-compatible Export', {type: 'S3Compatible',integration: 32,@@ -84,6 +90,7 @@ const S3_COMPATIBLE_BATCH_EXPORT = fixture('test-s3-compatible-id', 'S3-compatibuse_virtual_style_addressing: false,file_format: 'Parquet',max_file_size_mb: null,+ legacy_parquet_extension: false,},})@@ -305,6 +312,7 @@ const AZUREBLOB_BATCH_EXPORT = fixture('fixture-azureblob', 'Azure Blob Export',compression: 'zstd',file_format: 'Parquet',max_file_size_mb: null,+ legacy_parquet_extension: false,exclude_events: [],include_events: [],},@@ -377,6 +385,7 @@ const REDSHIFT_COPY_INTEGRATIONS_BATCH_EXPORT = fixture(const ALL_BATCH_EXPORTS: BatchExportConfiguration[] = [AWS_S3_BATCH_EXPORT,AWS_S3_GZIP_BATCH_EXPORT,+ AWS_S3_LEGACY_EXTENSION_BATCH_EXPORT,S3_COMPATIBLE_BATCH_EXPORT,BIGQUERY_BATCH_EXPORT,BIGQUERY_STALE_BATCH_EXPORT,@@ -1319,6 +1328,23 @@ describe('batchExportConfigFormLogic', () => {})})+ describe('Parquet extension opt-in', () => {+ it('sends the switched-off value so new files drop the codec suffix', async () => {+ await initLogic({ service: null, id: AWS_S3_LEGACY_EXTENSION_BATCH_EXPORT.id })++ logic.actions.setConfigurationValues({+ ...logic.values.configuration,+ legacy_parquet_extension: false,+ })++ await expectLogic(logic, () => {+ logic.actions.submitConfiguration()+ }).toDispatchActions(['submitConfiguration', 'updateBatchExportConfigSuccess'])++ expect(lastPatchBody!.destination.config.legacy_parquet_extension).toBe(false)+ })+ })+describe('strips stale/legacy config fields not in the destination allowlist', () => {// Pre-Integration configs can still hold credential fields that now live on the integration.// Editing such an export must not re-send them, or the backend rejects the PATCH withdiff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsxindex a26868bc4f7a..ce00f90a0822 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsx@@ -31,6 +31,7 @@ export const awsS3Definition: DestinationDefinition = {'file_format','compression','max_file_size_mb',+ 'legacy_parquet_extension','encryption','kms_key_id',],@@ -39,11 +40,12 @@ export const awsS3Definition: DestinationDefinition = {}),eventTableExtraFields: S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,eventTableOverrides: { includeGenericPersonFields: false },- Fields: function AwsS3Fields({ isNew, formValues }) {+ Fields: function AwsS3Fields({ isNew, formValues, savedConfig }) {return (<S3FamilyFieldsisNew={isNew}formValues={formValues}+ savedConfig={savedConfig}regionOptions={AWS_ONLY_REGION_OPTIONS}showEncryptionshowVirtualStyleAddressing={false}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/azureblob.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/azureblob.tsxindex ef8b67492d99..91e82ae2d7cf 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/azureblob.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/azureblob.tsx@@ -8,6 +8,7 @@ import {FileFormatField,MaxFileSizeField,PERSON_PROPERTIES_EVENT_FIELD,+ ParquetExtensionField,validateAzureContainerName,} from './common'import type { DestinationDefinition } from './types'@@ -20,13 +21,20 @@ export const azureBlobDefinition: DestinationDefinition = {compression: 'zstd',}),requiredFields: ({ isNew }) => ['integration_id', 'container_name', ...(isNew ? ['file_format'] : [])],- configKeys: ['container_name', 'prefix', 'compression', 'file_format', 'max_file_size_mb'],+ configKeys: [+ 'container_name',+ 'prefix',+ 'compression',+ 'file_format',+ 'max_file_size_mb',+ 'legacy_parquet_extension',+ ],validate: (formValues) => ({container_name: validateAzureContainerName(formValues.container_name),}),eventTableOverrides: { teamIdHogql: 'team_id' },eventTableExtraFields: { ...PERSON_PROPERTIES_EVENT_FIELD },- Fields: function AzureBlobFields({ formValues }) {+ Fields: function AzureBlobFields({ isNew, formValues, savedConfig }) {return (<><LemonField name="integration_id" label="Azure connection">@@ -68,6 +76,13 @@ export const azureBlobDefinition: DestinationDefinition = {</div><CompressionField fileFormat={formValues.file_format} />++ <ParquetExtensionField+ isNew={isNew}+ fileFormat={formValues.file_format}+ compression={formValues.compression}+ savedConfig={savedConfig}+ /></>)},diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.test.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.test.tsxnew file mode 100644index 000000000000..8a3771dd5d0e--- /dev/null+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.test.tsx@@ -0,0 +1,40 @@+import { ParquetExtensionField, shouldShowParquetExtensionField } from './common'++describe('shouldShowParquetExtensionField', () => {+ const savedParquet = { file_format: 'Parquet', compression: 'zstd' }+ const shown = { isNew: false, fileFormat: 'Parquet', compression: 'zstd', savedConfig: savedParquet }++ it.each([+ ['a new export has nothing to grandfather', { ...shown, isNew: true }],+ ['the export has not loaded yet', { ...shown, savedConfig: null }],+ [+ 'the export has only ever written JSON Lines',+ { ...shown, savedConfig: { file_format: 'JSONLines', compression: 'gzip' } },+ ],+ [+ 'the export has only ever written uncompressed Parquet',+ { ...shown, savedConfig: { file_format: 'Parquet', compression: null } },+ ],+ [+ 'the export already opted in to the standard extension',+ { ...shown, savedConfig: { ...savedParquet, legacy_parquet_extension: false } },+ ],+ ['the format is being switched away from Parquet', { ...shown, fileFormat: 'JSONLines' }],+ ['compression is being turned off, so the name carries no codec either way', { ...shown, compression: null }],+ ])('is false when %s', (_, props) => {+ expect(shouldShowParquetExtensionField(props)).toBe(false)+ })++ it.each([+ ['the flag has not been stamped yet', savedParquet],+ ['the flag is explicitly on', { ...savedParquet, legacy_parquet_extension: true }],+ ])('is true for a grandfathered Parquet export when %s', (_, savedConfig) => {+ expect(shouldShowParquetExtensionField({ ...shown, savedConfig })).toBe(true)+ })++ // Called directly rather than rendered, because the LemonField body needs a surrounding kea form.+ it('decides whether the field renders', () => {+ expect(ParquetExtensionField({ ...shown, isNew: true })).toBeNull()+ expect(ParquetExtensionField(shown)).not.toBeNull()+ })+})diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsxindex ac961da3d466..43b7f4e306da 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx@@ -1,4 +1,4 @@-import { LemonCheckbox, LemonInput, LemonSelect, Link } from '@posthog/lemon-ui'+import { LemonCheckbox, LemonInput, LemonSelect, LemonSwitch, Link } from '@posthog/lemon-ui'import { IntegrationChoice } from 'lib/components/CyclotronJob/integrations/IntegrationChoice'import { LemonField } from 'lib/lemon-ui/LemonField'@@ -203,6 +203,15 @@ const JSONLINES_COMPRESSION_OPTIONS = [{ value: null, label: 'No compression' },]+// Mirrors COMPRESSION_EXTENSIONS in the backend's destinations/constants.py.+const COMPRESSION_EXTENSIONS: Record<string, string> = {+ gzip: 'gz',+ snappy: 'sz',+ brotli: 'br',+ zstd: 'zst',+ lz4: 'lz4',+}+export function isSelectedCompressionOptionValid(fileFormat: string | undefined, value: string | null): boolean {if (fileFormat === 'Parquet') {return PARQUET_COMPRESSION_OPTIONS.some((option) => option.value === value)@@ -246,6 +255,67 @@ export function FileFormatField(): JSX.Element {)}+interface ParquetExtensionFieldProps {+ isNew: boolean+ fileFormat: string | undefined+ compression: string | null | undefined+ savedConfig?: Record<string, any> | null+}++// The setting only changes a name that carries a codec, so it needs compressed Parquet on both+// sides: the form values say what the export is about to write, `savedConfig` what it has been+// writing. Without a codec the name is `.parquet` either way and the switch would do nothing.+//+// Reading the saved side also stops the field disappearing the moment the user switches it on.+export function shouldShowParquetExtensionField({+ isNew,+ fileFormat,+ compression,+ savedConfig,+}: ParquetExtensionFieldProps): boolean {+ if (isNew || fileFormat !== 'Parquet' || !compression || !COMPRESSION_EXTENSIONS[compression]) {+ return false+ }+ const wroteCompressedParquet = savedConfig?.file_format === 'Parquet' && !!savedConfig.compression+ return wroteCompressedParquet && savedConfig?.legacy_parquet_extension !== false+}++export function ParquetExtensionField(props: ParquetExtensionFieldProps): JSX.Element | null {+ if (!shouldShowParquetExtensionField(props)) {+ return null+ }++ const legacyExtension = `.parquet.${COMPRESSION_EXTENSIONS[props.compression as string]}`++ return (+ <LemonField+ name="legacy_parquet_extension"+ label="File extension"+ help="Note: switching this on cannot be undone; after you save, the setting no longer appears for this export."+ info={+ <>+ Parquet records the compression codec inside the file, so the standard extension is{' '}+ <code>.parquet</code> regardless of the codec. This export writes <code>{legacyExtension}</code>{' '}+ instead. Turn this on to name new files <code>.parquet</code>. Files already exported keep their+ names.+ </>+ }+ >+ {({ value, onChange }) => (+ <LemonSwitch+ label={`Use the standard .parquet extension rather than ${legacyExtension}`}+ // The stored setting names the legacy behaviour, so the switch reads the other+ // way round: turning it on opts the export out of that behaviour.+ checked={value === false}+ onChange={(checked) => onChange(!checked)}+ fullWidth+ bordered+ />+ )}+ </LemonField>+ )+}+export function MaxFileSizeField(): JSX.Element {return (<LemonField@@ -297,6 +367,7 @@ export const S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS: Record<string, DatabaseSchemaFiexport function S3FamilyFields({isNew,formValues,+ savedConfig,regionOptions,allowCustomRegion = false,showEncryption,@@ -305,6 +376,7 @@ export function S3FamilyFields({}: {isNew: booleanformValues: Record<string, any>+ savedConfig?: Record<string, any> | nullregionOptions: { value: string; label: string }[]// Let users type a region not in the preset list. True for the S3-compatible catch-all, where we// can't enumerate every provider's regions; false for AWS S3, whose regions are a closed set.@@ -393,11 +465,17 @@ export function S3FamilyFields({)}</div>+ <ParquetExtensionField+ isNew={isNew}+ fileFormat={formValues.file_format}+ compression={formValues.compression}+ savedConfig={savedConfig}+ />+{showVirtualStyleAddressing && (<LemonFieldname="use_virtual_style_addressing"label="Virtual style addressing"- showOptionalinfo={<>Some non-AWS S3-compatible destinations may require this setting enabled. Check yourdiff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsxindex bb93ffd791e8..df221405d823 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsx@@ -27,6 +27,7 @@ export const s3CompatibleDefinition: DestinationDefinition = {'file_format','compression','max_file_size_mb',+ 'legacy_parquet_extension','use_virtual_style_addressing',],validate: (formValues) => ({@@ -34,11 +35,12 @@ export const s3CompatibleDefinition: DestinationDefinition = {}),eventTableExtraFields: S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,eventTableOverrides: { includeGenericPersonFields: false },- Fields: function S3CompatibleFields({ isNew, formValues }) {+ Fields: function S3CompatibleFields({ isNew, formValues, savedConfig }) {return (<S3FamilyFieldsisNew={isNew}formValues={formValues}+ savedConfig={savedConfig}regionOptions={S3_REGION_OPTIONS}allowCustomRegionshowEncryption={false}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/types.ts b/frontend/src/scenes/data-pipelines/batch-exports/destinations/types.tsindex c6b202be09f9..6e625958f758 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/types.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/types.ts@@ -8,6 +8,7 @@ export type BatchExportServiceType = BatchExportService['type']export interface DestinationContext {isNew: booleanformValues: Record<string, any>+ savedConfig?: Record<string, any> | null// The Integration currently picked in the form, when the destination uses one. Null while// integrations are still loading, or when the picked one no longer exists.selectedIntegration?: IntegrationType | nulldiff --git a/products/batch_exports/backend/api/batch_export.py b/products/batch_exports/backend/api/batch_export.pyindex 9f31f5fca682..47b234f9b8b5 100644--- a/products/batch_exports/backend/api/batch_export.py+++ b/products/batch_exports/backend/api/batch_export.py@@ -55,6 +55,7 @@ from posthog.utils import relative_date_parse, str_to_boolfrom products.batch_exports.backend.api.destination_tests import get_destination_testfrom products.batch_exports.backend.models.batch_export import (BATCH_EXPORT_INTERVALS,+ OBJECT_STORAGE_DESTINATIONS,S3_FAMILY_TYPES,TIMEZONES,BatchExport,@@ -377,6 +378,15 @@ class PostgresDestinationConfigSerializer(serializers.Serializer):)+LEGACY_PARQUET_EXTENSION_HELP_TEXT = (+ "Whether Parquet files keep the compression codec in their extension, for example "+ "'.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new "+ "exports leave it out. An export that already wrote Parquet files before this setting existed "+ "keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON "+ "Lines, which always carries the codec in its extension."+)++class AzureBlobDestinationConfigSerializer(serializers.Serializer):"""Typed configuration for an Azure Blob Storage batch-export destination.@@ -411,6 +421,11 @@ class AzureBlobDestinationConfigSerializer(serializers.Serializer):help_text="If set, rolls to a new file once the current file exceeds this size in MB.",)+ legacy_parquet_extension = serializers.BooleanField(+ required=False,+ help_text=LEGACY_PARQUET_EXTENSION_HELP_TEXT,+ )+class S3FamilyDestinationConfigSerializer(serializers.Serializer):"""Shared non-credential configuration for S3-family batch-export destinations.@@ -443,6 +458,11 @@ class S3FamilyDestinationConfigSerializer(serializers.Serializer):help_text="If set, rolls to a new file once the current file exceeds this size in MB.",)+ legacy_parquet_extension = serializers.BooleanField(+ required=False,+ help_text=LEGACY_PARQUET_EXTENSION_HELP_TEXT,+ )+class AwsS3DestinationConfigSerializer(S3FamilyDestinationConfigSerializer):"""Typed configuration for an AWS S3 batch-export destination.@@ -842,6 +862,56 @@ S3_DESTINATION_TO_INTEGRATION_KIND: dict[str, Integration.IntegrationKind] = {}+def _writes_compressed_parquet(config: dict[str, typing.Any]) -> bool:+ """Whether a config produces Parquet file names that carry a compression codec."""+ return config.get("file_format") == "Parquet" and config.get("compression") is not None+++def _uses_legacy_parquet_extension(destination_type: str, stored_config: dict[str, typing.Any]) -> bool:+ """Whether an export's stored config already writes the codec into its Parquet file names.++ Reads through `coerce_config_to_declared_types`, because `EncryptedJSONField` stringifies+ scalars on write and the string "False" is truthy.+ """+ coerced = coerce_config_to_declared_types(destination_type, stored_config)+ stored = coerced.get("legacy_parquet_extension")+ if stored is None:+ # export was created before the `legacy_parquet_extension` field was added+ # so will use the legacy extension if it writes compressed Parquet files+ return _writes_compressed_parquet(coerced)+ return bool(stored)+++def _set_default_parquet_extension(destination_type: str, config: dict[str, typing.Any]) -> None:+ """Opt a newly created destination into the standard `.parquet` extension.++ The workflow input dataclasses default this to `True`, so that an export whose Temporal+ schedule predates the field keeps the same file extension as before in order to maintain+ compatibility.+ """+ if destination_type in OBJECT_STORAGE_DESTINATIONS:+ config.setdefault("legacy_parquet_extension", False)+++def _pin_existing_parquet_extension(destination_type: str, stored_config: dict[str, typing.Any]) -> None:+ """Record what an export's file names already look like, before a patch can change its format.++ An export that predates this setting has no value for it, and a missing value reads as the+ legacy naming. That is correct only for an export that already writes names carrying a codec,+ which means Parquet with a compression codec set. An export on JSON Lines, or on Parquet with+ no compression, has no such names to keep, so moving it to compressed Parquet has to produce+ `.parquet` rather than `.parquet.zst`.++ Takes the config as stored, before the incoming patch merges into it, so the value reflects+ what the export has been running rather than what it is moving to. An explicit value in the+ patch still wins, because the merge applies afterwards.+ """+ if destination_type not in OBJECT_STORAGE_DESTINATIONS:+ return++ stored_config.setdefault("legacy_parquet_extension", _writes_compressed_parquet(stored_config))++def _coerce_integration_id(value: typing.Any) -> int | None:"""Return the integration id encoded in a Redshift COPY credential value, if any.@@ -1347,6 +1417,18 @@ class BatchExportSerializer(serializers.ModelSerializer):"Delete this batch export and create a new one with the new destination type.")+ # This setting is used for grandfathered exports that used the legacy Parquet file extension,+ # and is a one-way migration; once exports use the new `.parquet` extension it is not+ # possible to go back to using the legacy extension.+ if config.get("legacy_parquet_extension") is True and not _uses_legacy_parquet_extension(+ destination_type, existing_config+ ):+ raise serializers.ValidationError(+ "'legacy_parquet_extension' can only stay on for an export that already writes the "+ "compression codec into its Parquet file names. It cannot be turned on for a new "+ "export, or turned back on once an export moved to the standard '.parquet' extension."+ )+# The legacy `S3` type predates both the AwsS3/S3Compatible split and integration-backed# credentials. Every row has been migrated off it, so it accepts no writes at all.if destination_type == BatchExportDestination.Destination.S3:@@ -1631,6 +1713,8 @@ class BatchExportSerializer(serializers.ModelSerializer):batch_export_schema = self.serialize_hogql_query_to_batch_export_schema(hogql_query)validated_data["schema"] = batch_export_schema+ _set_default_parquet_extension(destination_data["type"], destination_data["config"])+destination = BatchExportDestination(**destination_data)batch_export = BatchExport(team_id=team_id, destination=destination, **validated_data)@@ -1763,6 +1847,7 @@ class BatchExportSerializer(serializers.ModelSerializer):if destination_data:# Type changes are rejected by `validate_destination` — the incoming `type`# (if any) always equals the existing type by the time we get here.+ _pin_existing_parquet_extension(batch_export.destination.type, batch_export.destination.config)batch_export.destination.config = recursive_dict_merge(batch_export.destination.config,destination_data.get("config", {}),diff --git a/products/batch_exports/backend/models/batch_export.py b/products/batch_exports/backend/models/batch_export.pyindex 3096c98e5284..896029c077dd 100644--- a/products/batch_exports/backend/models/batch_export.py+++ b/products/batch_exports/backend/models/batch_export.py@@ -28,6 +28,15 @@ TIMEZONES = [(tz, tz) for tz in pytz.all_timezones]# type which has now been fully deprecated.S3_FAMILY_TYPES: frozenset[str] = frozenset({"AwsS3", "S3Compatible"})+# Destinations that write files to object storage, as opposed to the data warehouse destinations+# (BigQuery, Databricks, Postgres, Redshift, Snowflake) that write rows into a table. File format,+# compression and object key layout are questions only this half has to answer.+#+# Also includes "FileDownload", which writes to a PostHog bucket rather than a customer one.+# TODO: it probably makes sense to introduce a 'DestinationKind' abstraction in the future,+# to properly categorize object storage and data warehouse destinations.+OBJECT_STORAGE_DESTINATIONS: frozenset[str] = frozenset({"S3", "AwsS3", "S3Compatible", "AzureBlob", "FileDownload"})+class DayOfWeek(IntEnum):"""Day of the week enum for batch export schedules.diff --git a/products/batch_exports/backend/service.py b/products/batch_exports/backend/service.pyindex 6d9928780e13..0b45101c3da9 100644--- a/products/batch_exports/backend/service.py+++ b/products/batch_exports/backend/service.py@@ -282,6 +282,10 @@ class S3BatchExportInputs(BaseBatchExportInputs):kms_key_id: KMS key id to use when `encryption == "aws:kms"`, or None. AWS-only.use_virtual_style_addressing: Whether to use virtual-hosted-styleaddressing rather than path-style. None for AWS.+ legacy_parquet_extension: Whether Parquet files keep the compression codec in their+ extension, e.g. `.parquet.zst` rather than `.parquet`. Defaults to True because a+ schedule created before this field existed has no value for it, so the missing field+ decodes to this default and the export keeps the names it already writes."""bucket_name: str@@ -293,6 +297,7 @@ class S3BatchExportInputs(BaseBatchExportInputs):encryption: str | None = Nonekms_key_id: str | None = Noneuse_virtual_style_addressing: bool = False+ legacy_parquet_extension: bool = True@dataclass(frozen=False, kw_only=True)@@ -310,6 +315,7 @@ class S3FamilyBaseInputs(BaseBatchExportInputs):compression: str | None = Nonefile_format: str = "JSONLines"max_file_size_mb: int | None = None+ legacy_parquet_extension: bool = True@dataclass(kw_only=True)@@ -511,7 +517,7 @@ class DatabricksBatchExportInputs(BaseBatchExportInputs):use_automatic_schema_evolution: bool = True-@dataclass(kw_only=True)+@dataclass(frozen=False, kw_only=True)class AzureBlobBatchExportInputs(BaseBatchExportInputs):"""Inputs for Azure Blob Storage export workflow.@@ -524,6 +530,7 @@ class AzureBlobBatchExportInputs(BaseBatchExportInputs):compression: str | None = Nonefile_format: str = "JSONLines"max_file_size_mb: int | None = None+ legacy_parquet_extension: bool = True@dataclass(kw_only=True)diff --git a/products/batch_exports/backend/temporal/destinations/azure_blob_batch_export.py b/products/batch_exports/backend/temporal/destinations/azure_blob_batch_export.pyindex a74a0c0c43a9..255d56f61e45 100644--- a/products/batch_exports/backend/temporal/destinations/azure_blob_batch_export.py+++ b/products/batch_exports/backend/temporal/destinations/azure_blob_batch_export.py@@ -33,6 +33,7 @@ from products.batch_exports.backend.temporal.batch_exports import ()from products.batch_exports.backend.temporal.destinations.constants import (AZURE_BLOB_SUPPORTED_COMPRESSIONS as SUPPORTED_COMPRESSIONS,+ FILE_FORMAT_EXTENSIONS,)from products.batch_exports.backend.temporal.destinations.utils import EXTERNAL_LOGGER, get_manifest_key, get_object_keyfrom products.batch_exports.backend.temporal.pipeline.consumer import Consumer, run_consumer_from_stage@@ -57,19 +58,6 @@ NON_RETRYABLE_ERROR_TYPES = ("UnsupportedFileFormatError",)-FILE_FORMAT_EXTENSIONS = {- "Parquet": "parquet",- "JSONLines": "jsonl",-}--COMPRESSION_EXTENSIONS = {- "gzip": "gz",- "brotli": "br",- "zstd": "zst",- "lz4": "lz4",- "snappy": "sz",-}-LOGGER = get_write_only_logger(__name__)@@ -115,7 +103,7 @@ def _is_authorization_failure_response_error(err: HttpResponseError) -> bool:return getattr(err, "error_code", None) == StorageErrorCode.AUTHORIZATION_FAILURE[email protected](kw_only=True)[email protected](frozen=False, kw_only=True)class AzureBlobInsertInputs(BatchExportInsertInputs):container_name: strintegration_id: int@@ -123,6 +111,9 @@ class AzureBlobInsertInputs(BatchExportInsertInputs):compression: str | None = Nonefile_format: str = "JSONLines"max_file_size_mb: int | None = None+ # Defaults to the legacy naming: an activity input recorded before this field existed has no+ # value for it, so the missing field uses this default and the export keeps its existing names.+ legacy_parquet_extension: bool = Trueasync def _get_azure_blob_integration(integration_id: int, team_id: int) -> AzureBlobIntegration:@@ -155,6 +146,7 @@ class AzureBlobConsumer(Consumer):compression: str | None = None,max_file_size_mb: int | None = None,max_concurrency: int = 5,+ legacy_parquet_extension: bool = True,):super().__init__(model=batch_export_model.name if batch_export_model else "events")@@ -167,6 +159,7 @@ class AzureBlobConsumer(Consumer):self.compression = compressionself.max_file_size_mb = max_file_size_mbself.max_concurrency = max_concurrency+ self.legacy_parquet_extension = legacy_parquet_extensionself.current_buffer = bytearray()self.current_file_index = 0@@ -212,6 +205,7 @@ class AzureBlobConsumer(Consumer):compression=inputs.compression,max_file_size_mb=inputs.max_file_size_mb,max_concurrency=max_concurrency,+ legacy_parquet_extension=inputs.legacy_parquet_extension,)async def consume_chunk(self, data: bytes):@@ -239,8 +233,9 @@ class AzureBlobConsumer(Consumer):data_interval_start=self.data_interval_start,data_interval_end=self.data_interval_end,batch_export_model=self.batch_export_model,- file_extension=FILE_FORMAT_EXTENSIONS[self.file_format],- compression_extension=COMPRESSION_EXTENSIONS[self.compression] if self.compression is not None else None,+ file_format=self.file_format,+ compression=self.compression,+ legacy_parquet_extension=self.legacy_parquet_extension,file_number=self.current_file_index,include_file_number=bool(self.max_file_size_mb),)@@ -313,8 +308,9 @@ async def insert_into_azure_blob_activity_from_stage(inputs: AzureBlobInsertInpudata_interval_start=inputs.data_interval_start,data_interval_end=inputs.data_interval_end,batch_export_model=inputs.batch_export_model,- file_extension=FILE_FORMAT_EXTENSIONS[inputs.file_format],- compression_extension=COMPRESSION_EXTENSIONS[inputs.compression] if inputs.compression is not None else None,+ file_format=inputs.file_format,+ compression=inputs.compression,+ legacy_parquet_extension=inputs.legacy_parquet_extension,include_file_number=bool(inputs.max_file_size_mb),)@@ -434,6 +430,7 @@ class AzureBlobBatchExportWorkflow(PostHogWorkflow):include_events=inputs.include_events,file_format=inputs.file_format,max_file_size_mb=inputs.max_file_size_mb,+ legacy_parquet_extension=inputs.legacy_parquet_extension,run_id=run_id,backfill_details=inputs.backfill_details,is_backfill=is_backfill,diff --git a/products/batch_exports/backend/temporal/destinations/constants.py b/products/batch_exports/backend/temporal/destinations/constants.pyindex 687949bab3a0..92930847904a 100644--- a/products/batch_exports/backend/temporal/destinations/constants.py+++ b/products/batch_exports/backend/temporal/destinations/constants.py@@ -14,3 +14,16 @@ AZURE_BLOB_SUPPORTED_COMPRESSIONS: dict[str, list[str]] = {"Parquet": ["zstd", "lz4", "snappy", "gzip", "brotli"],"JSONLines": ["gzip", "brotli"],}++FILE_FORMAT_EXTENSIONS: dict[str, str] = {+ "Parquet": "parquet",+ "JSONLines": "jsonl",+}++COMPRESSION_EXTENSIONS: dict[str, str] = {+ "gzip": "gz",+ "snappy": "sz",+ "brotli": "br",+ "zstd": "zst",+ "lz4": "lz4",+}diff --git a/products/batch_exports/backend/temporal/destinations/file_download_batch_export.py b/products/batch_exports/backend/temporal/destinations/file_download_batch_export.pyindex 53a704811afc..2606eda80ad3 100644--- a/products/batch_exports/backend/temporal/destinations/file_download_batch_export.py+++ b/products/batch_exports/backend/temporal/destinations/file_download_batch_export.py@@ -273,6 +273,10 @@ async def export_to_file_download_bucket_with_temporary_credentials(inputs: Expobatch_export_model=inputs.batch_export.batch_export_model,batch_export_id=inputs.batch_export.batch_export_id,destination_default_fields=inputs.batch_export.destination_default_fields,+ # These files live in a PostHog bucket, expire on a lifecycle rule, and are reached through+ # a key stored on `BatchExportFileDownload`. No customer pipeline matches on their names, so+ # there is nothing to grandfather and they always use the standard extension.+ legacy_parquet_extension=False,)# Minting the first credentials calls AWS STS, and this activity heartbeats every 10 seconds,# so the call runs under the heartbeater rather than ahead of it.diff --git a/products/batch_exports/backend/temporal/destinations/s3_batch_export.py b/products/batch_exports/backend/temporal/destinations/s3_batch_export.pyindex 88ac5ff6dc2e..d12e7fd9cb9b 100644--- a/products/batch_exports/backend/temporal/destinations/s3_batch_export.py+++ b/products/batch_exports/backend/temporal/destinations/s3_batch_export.py@@ -54,6 +54,7 @@ from products.batch_exports.backend.temporal.batch_exports import (start_batch_export_run,)from products.batch_exports.backend.temporal.destinations.constants import (+ FILE_FORMAT_EXTENSIONS,S3_SUPPORTED_COMPRESSIONS as SUPPORTED_COMPRESSIONS,)from products.batch_exports.backend.temporal.destinations.utils import (@@ -109,19 +110,6 @@ NON_RETRYABLE_ERROR_TYPES = ("IntegrationError",)-FILE_FORMAT_EXTENSIONS = {- "Parquet": "parquet",- "JSONLines": "jsonl",-}--COMPRESSION_EXTENSIONS = {- "gzip": "gz",- "snappy": "sz",- "brotli": "br",- "zstd": "zst",- "lz4": "lz4",-}-LOGGER = get_write_only_logger(__name__)EXTERNAL_LOGGER = get_logger("EXTERNAL")TRACER = trace.get_tracer(__name__)@@ -226,6 +214,9 @@ class S3InsertInputs(BatchExportInsertInputs):file_format: str = "JSONLines"max_file_size_mb: int | None = Noneuse_virtual_style_addressing: bool = False+ # Defaults to the legacy naming: an activity input recorded before this field existed has no+ # value for it, so the missing field uses this default and the export keeps its existing names.+ legacy_parquet_extension: bool = Truedef get_s3_key_from_inputs(inputs: S3InsertInputs, file_number: int = 0) -> str:@@ -234,8 +225,9 @@ def get_s3_key_from_inputs(inputs: S3InsertInputs, file_number: int = 0) -> str:data_interval_start=inputs.data_interval_start,data_interval_end=inputs.data_interval_end,batch_export_model=inputs.batch_export_model,- file_extension=FILE_FORMAT_EXTENSIONS[inputs.file_format],- compression_extension=COMPRESSION_EXTENSIONS[inputs.compression] if inputs.compression is not None else None,+ file_format=inputs.file_format,+ compression=inputs.compression,+ legacy_parquet_extension=inputs.legacy_parquet_extension,file_number=file_number,include_file_number=bool(inputs.max_file_size_mb),)@@ -379,6 +371,7 @@ class S3BatchExportWorkflow(PostHogWorkflow):is_backfill=is_backfill,batch_export_model=inputs.batch_export_model,use_virtual_style_addressing=inputs.use_virtual_style_addressing,+ legacy_parquet_extension=inputs.legacy_parquet_extension,# TODO: Remove after updating existing batch exports.batch_export_schema=inputs.batch_export_schema,batch_export_id=inputs.batch_export_id,@@ -847,6 +840,7 @@ class ConcurrentS3Consumer(Consumer):compression: str | None = None,encryption: str | None = None,use_virtual_style_addressing: bool = False,+ legacy_parquet_extension: bool = True,part_size: int = 50 * 1024 * 1024, # 50MB partsmax_concurrent_uploads: int = 5,):@@ -865,6 +859,7 @@ class ConcurrentS3Consumer(Consumer):self.file_format = file_formatself.compression = compressionself.encryption = encryption+ self.legacy_parquet_extension = legacy_parquet_extension# This is only needed to obtain a file key. It's very easy to confuse it with# the transformer's `max_file_size_bytes` which actually does the file splitting.# TODO: Remove this from here, figure out a different way to obtain an S3 key.@@ -919,6 +914,7 @@ class ConcurrentS3Consumer(Consumer):max_file_size_mb=s3_inputs.max_file_size_mb,kms_key_id=s3_inputs.kms_key_id,use_virtual_style_addressing=s3_inputs.use_virtual_style_addressing,+ legacy_parquet_extension=s3_inputs.legacy_parquet_extension,part_size=part_size,max_concurrent_uploads=max_concurrent_uploads,)@@ -1121,8 +1117,9 @@ class ConcurrentS3Consumer(Consumer):data_interval_start=self.data_interval_start,data_interval_end=self.data_interval_end,batch_export_model=self.batch_export_model,- file_extension=FILE_FORMAT_EXTENSIONS[self.file_format],- compression_extension=COMPRESSION_EXTENSIONS[self.compression] if self.compression is not None else None,+ file_format=self.file_format,+ compression=self.compression,+ legacy_parquet_extension=self.legacy_parquet_extension,file_number=self.current_file_index,include_file_number=bool(self.max_file_size_mb),)diff --git a/products/batch_exports/backend/temporal/destinations/utils.py b/products/batch_exports/backend/temporal/destinations/utils.pyindex b1e6848a601d..a2044bce5c1b 100644--- a/products/batch_exports/backend/temporal/destinations/utils.py+++ b/products/batch_exports/backend/temporal/destinations/utils.py@@ -4,6 +4,10 @@ import posixpathfrom posthog.temporal.common.logger import get_loggerfrom products.batch_exports.backend.service import BatchExportModel+from products.batch_exports.backend.temporal.destinations.constants import (+ COMPRESSION_EXTENSIONS,+ FILE_FORMAT_EXTENSIONS,+)EXTERNAL_LOGGER = get_logger("EXTERNAL")@@ -65,13 +69,31 @@ def get_manifest_key(return posixpath.join(key_prefix, f"{data_interval_start}-{data_interval_end}_manifest.json")+def _get_compression_extension(file_format: str, compression: str | None, legacy_parquet_extension: bool) -> str | None:+ """Resolve the codec suffix that follows the file format extension, if any.++ Parquet gets no codec suffix, because it records the codec inside the file and a reader opens+ it as Parquet whatever the codec is. `legacy_parquet_extension` keeps the suffix for an export+ that already wrote Parquet files before this rule, whose downstream pipeline may match on the+ old names.+ """+ if compression is None:+ return None++ if file_format == "Parquet" and not legacy_parquet_extension:+ return None++ return COMPRESSION_EXTENSIONS[compression]++def get_object_key(prefix: str,data_interval_start: str | None,data_interval_end: str,batch_export_model: BatchExportModel | None,- file_extension: str,- compression_extension: str | None = None,+ file_format: str,+ compression: str | None = None,+ legacy_parquet_extension: bool = False,file_number: int = 0,include_file_number: bool = False,) -> str:@@ -83,6 +105,9 @@ def get_object_key(if include_file_number:base_file_name = f"{base_file_name}-{file_number}"+ file_extension = FILE_FORMAT_EXTENSIONS[file_format]+ compression_extension = _get_compression_extension(file_format, compression, legacy_parquet_extension)+if compression_extension is not None:file_name = f"{base_file_name}.{file_extension}.{compression_extension}"else:diff --git a/products/batch_exports/backend/tests/api/test_create.py b/products/batch_exports/backend/tests/api/test_create.pyindex 8a70c79653be..02f783de5270 100644--- a/products/batch_exports/backend/tests/api/test_create.py+++ b/products/batch_exports/backend/tests/api/test_create.py@@ -54,6 +54,7 @@ def test_create_batch_export_with_interval_schedule("region": "us-east-1","prefix": "posthog-events/","use_virtual_style_addressing": True,+ "legacy_parquet_extension": False,},"integration": s3_compatible_integration.id,}@@ -107,6 +108,7 @@ def test_create_batch_export_with_interval_schedule(assert args["region"] == "us-east-1"assert args["prefix"] == "posthog-events/"assert args["use_virtual_style_addressing"]+ assert args["legacy_parquet_extension"] is False# Credentials are resolved from the integration at run time, never carried in the schedule.assert args["integration_id"] == s3_compatible_integration.idassert args.get("aws_access_key_id") is Nonediff --git a/products/batch_exports/backend/tests/api/test_create_s3.py b/products/batch_exports/backend/tests/api/test_create_s3.pyindex c48be3644c68..70929f7ccc5b 100644--- a/products/batch_exports/backend/tests/api/test_create_s3.py+++ b/products/batch_exports/backend/tests/api/test_create_s3.py@@ -60,6 +60,8 @@ def test_create_s3_family_batch_export()assert response.status_code == status.HTTP_201_CREATED, response.json()assert response.json()["destination"]["type"] == expected_persisted_type+ # A destination created now has no Parquet files to grandfather, so it starts on `.parquet`.+ assert response.json()["destination"]["config"]["legacy_parquet_extension"] is False@pytest.mark.parametrize("destination_type", sorted(S3_FAMILY_TYPES))@@ -315,3 +317,33 @@ def test_create_s3_family_batch_export_rejects_mismatched_integration_kind(},)assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+++def test_create_s3_family_batch_export_rejects_an_explicit_legacy_parquet_extension(+ client: HttpClient, temporal, organization, team, user, aws_s3_integration+):+ """A new export has written nothing, so it has no file names to grandfather."""+ destination_type = "AwsS3"+ integration = aws_s3_integration+ client.force_login(user)+ response = create_batch_export(+ client,+ team.pk,+ {+ "name": "my-export",+ "interval": "hour",+ "destination": {+ "type": destination_type,+ "config": {+ **_S3_FAMILY_BASE_CONFIG,+ "file_format": "Parquet",+ "compression": "zstd",+ "legacy_parquet_extension": True,+ },+ "integration": integration.id,+ },+ },+ )++ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert "legacy_parquet_extension" in response.json()["detail"]diff --git a/products/batch_exports/backend/tests/api/test_get.py b/products/batch_exports/backend/tests/api/test_get.pyindex f182491c9dad..e76f0ab40ff6 100644--- a/products/batch_exports/backend/tests/api/test_get.py+++ b/products/batch_exports/backend/tests/api/test_get.py@@ -91,6 +91,7 @@ def test_can_get_exports_for_your_organizations("bucket_name": "my-production-s3-bucket","region": "us-east-1","prefix": "posthog-events/",+ "legacy_parquet_extension": False,}diff --git a/products/batch_exports/backend/tests/api/test_update_s3.py b/products/batch_exports/backend/tests/api/test_update_s3.pyindex eb642c6ce58e..eb73f823eb7a 100644--- a/products/batch_exports/backend/tests/api/test_update_s3.py+++ b/products/batch_exports/backend/tests/api/test_update_s3.py@@ -156,3 +156,120 @@ def test_updating_legacy_s3_batch_export_is_rejected(client: HttpClient, tempora)assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()assert "deprecated" in response.json()["detail"]+++def test_updating_s3_family_batch_export_preserves_legacy_parquet_extension(+ client: HttpClient, temporal, organization, team, user+):+ """A grandfathered export keeps its file names when a patch does not mention the setting.++ The frontend only renders the setting for an export that still has it on, so every other+ patch omits the key and must not turn it off.+ """+ destination_type, kind, integration_config = _S3_FAMILY_INTEGRATIONS[0]+ _, batch_export = _create_integration_backed_export(client, team, user, destination_type, kind, integration_config)+ destination = BatchExportDestination.objects.get(batchexport__id=batch_export["id"])+ destination.config = {**destination.config, "legacy_parquet_extension": True}+ destination.save()++ response = patch_batch_export(+ client,+ team.pk,+ batch_export["id"],+ {"destination": {"type": destination_type, "config": {"prefix": "new-prefix/"}}},+ )++ assert response.status_code == status.HTTP_200_OK, response.json()+ config = response.json()["destination"]["config"]+ assert config["prefix"] == "new-prefix/"+ assert config["legacy_parquet_extension"] is True+++ "stored_file_format,stored_compression,expected",+ [+ ("Parquet", "zstd", True),+ ("JSONLines", "gzip", False),+ ("Parquet", None, False),+ ],+)+def test_updating_s3_family_batch_export_pins_naming_from_the_stored_config(+ client: HttpClient, temporal, organization, team, user, stored_file_format, stored_compression, expected+):+ """An export with no stored value records its naming from what it was already writing.++ Only an export already writing compressed Parquet has names carrying a codec. One on JSON+ Lines, or on Parquet with no compression, has none, so moving it to compressed Parquet must+ produce '.parquet'.+ """+ destination_type, kind, integration_config = _S3_FAMILY_INTEGRATIONS[0]+ _, batch_export = _create_integration_backed_export(client, team, user, destination_type, kind, integration_config)+ destination = BatchExportDestination.objects.get(batchexport__id=batch_export["id"])+ destination.config = {+ **destination.config,+ "file_format": stored_file_format,+ "compression": stored_compression,+ }+ # remove any stored value for legacy_parquet_extension to mimic an existing batch export+ destination.config.pop("legacy_parquet_extension", None)+ destination.save()++ response = patch_batch_export(+ client,+ team.pk,+ batch_export["id"],+ {"destination": {"type": destination_type, "config": {"file_format": "Parquet", "compression": "zstd"}}},+ )++ assert response.status_code == status.HTTP_200_OK, response.json()+ config = response.json()["destination"]["config"]+ assert config["file_format"] == "Parquet"+ assert config["legacy_parquet_extension"] is expected+++def test_updating_s3_family_batch_export_rejects_turning_legacy_naming_back_on(+ client: HttpClient, temporal, organization, team, user+):+ """Moving to `.parquet` is one way, and the frontend states that, so the API has to hold it."""+ destination_type, kind, integration_config = _S3_FAMILY_INTEGRATIONS[0]+ _, batch_export = _create_integration_backed_export(client, team, user, destination_type, kind, integration_config)+ destination = BatchExportDestination.objects.get(batchexport__id=batch_export["id"])+ destination.config = {+ **destination.config,+ "file_format": "Parquet",+ "compression": "zstd",+ "legacy_parquet_extension": False,+ }+ destination.save()++ response = patch_batch_export(+ client,+ team.pk,+ batch_export["id"],+ {"destination": {"type": destination_type, "config": {"legacy_parquet_extension": True}}},+ )++ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert "legacy_parquet_extension" in response.json()["detail"]+++def test_updating_s3_family_batch_export_lets_a_grandfathered_export_keep_legacy_naming(+ client: HttpClient, temporal, organization, team, user+):+ """An export still on the legacy names may resend the value, which is what the form does."""+ destination_type, kind, integration_config = _S3_FAMILY_INTEGRATIONS[0]+ _, batch_export = _create_integration_backed_export(client, team, user, destination_type, kind, integration_config)+ destination = BatchExportDestination.objects.get(batchexport__id=batch_export["id"])+ destination.config = {**destination.config, "file_format": "Parquet", "compression": "zstd"}+ destination.config.pop("legacy_parquet_extension", None)+ destination.save()++ response = patch_batch_export(+ client,+ team.pk,+ batch_export["id"],+ {"destination": {"type": destination_type, "config": {"legacy_parquet_extension": True}}},+ )++ assert response.status_code == status.HTTP_200_OK, response.json()+ assert response.json()["destination"]["config"]["legacy_parquet_extension"] is Truediff --git a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_utils.py b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_utils.pyindex 6afb7a81c806..5b4f29fcb9b4 100644--- a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_utils.py+++ b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_utils.py@@ -1,35 +1,39 @@import pytest-from products.batch_exports.backend.temporal.destinations.azure_blob_batch_export import (- COMPRESSION_EXTENSIONS,- FILE_FORMAT_EXTENSIONS,-)from products.batch_exports.backend.temporal.destinations.utils import get_key_prefix, get_manifest_key, get_object_keypytestmark = [pytest.mark.asyncio, pytest.mark.django_db]@pytest.mark.parametrize(- "file_format,compression,expected_filename",+ "file_format,compression,legacy_parquet_extension,expected_filename",[- ("JSONLines", None, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl"),- ("JSONLines", "gzip", "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.gz"),- ("JSONLines", "brotli", "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.br"),- ("JSONLines", "zstd", "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.zst"),- ("Parquet", None, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),- ("Parquet", "gzip", "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.gz"),- ("Parquet", "brotli", "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.br"),- ("Parquet", "zstd", "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.zst"),+ ("JSONLines", None, False, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl"),+ ("JSONLines", "gzip", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.gz"),+ ("JSONLines", "brotli", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.br"),+ ("JSONLines", "zstd", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.zst"),+ ("JSONLines", "gzip", True, "2024-01-01T00:00:00-2024-01-01T01:00:00.jsonl.gz"),+ ("Parquet", None, False, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),+ ("Parquet", "gzip", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),+ ("Parquet", "brotli", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),+ ("Parquet", "zstd", False, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),+ ("Parquet", None, True, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet"),+ ("Parquet", "gzip", True, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.gz"),+ ("Parquet", "brotli", True, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.br"),+ ("Parquet", "zstd", True, "2024-01-01T00:00:00-2024-01-01T01:00:00.parquet.zst"),],)-def test_get_object_key_generates_correct_extension(file_format, compression, expected_filename):+def test_get_object_key_generates_correct_extension(+ file_format, compression, legacy_parquet_extension, expected_filename+):key = get_object_key(prefix="exports/",data_interval_start="2024-01-01T00:00:00",data_interval_end="2024-01-01T01:00:00",batch_export_model=None,- file_extension=FILE_FORMAT_EXTENSIONS[file_format],- compression_extension=COMPRESSION_EXTENSIONS.get(compression),+ file_format=file_format,+ compression=compression,+ legacy_parquet_extension=legacy_parquet_extension,)assert key == f"exports/{expected_filename}"@@ -40,8 +44,7 @@ def test_get_object_key_includes_file_number_when_splitting():data_interval_start="2024-01-01T00:00:00",data_interval_end="2024-01-01T01:00:00",batch_export_model=None,- file_extension=FILE_FORMAT_EXTENSIONS["JSONLines"],- compression_extension=None,+ file_format="JSONLines",file_number=5,include_file_number=True,)diff --git a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_workflow_execution.py b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_workflow_execution.pyindex d39f56663369..2531e9b69841 100644--- a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_workflow_execution.py+++ b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/test_workflow_execution.py@@ -65,6 +65,45 @@ async def test_workflow_exports_model_successfully()[email protected]("interval", ["hour"], indirect=True)[email protected]("file_format", ["Parquet"], indirect=True)[email protected]("compression", ["zstd"], indirect=True)[email protected](("legacy_parquet_extension", "expected_suffix"), [(True, ".parquet.zst"), (False, ".parquet")])+async def test_workflow_names_parquet_blobs_by_the_extension_setting(+ ateam,+ azure_batch_export,+ azurite_container,+ container_name,+ blob_prefix,+ interval,+ file_format,+ compression,+ data_interval_end,+ generate_test_data,+ legacy_parquet_extension,+ expected_suffix,+):+ run = await run_azure_blob_batch_export_workflow(+ team=ateam,+ batch_export_id=str(azure_batch_export.id),+ container_name=container_name,+ prefix=blob_prefix,+ interval=interval,+ data_interval_end=data_interval_end,+ integration_id=azure_batch_export.destination.integration.id,+ file_format=file_format,+ compression=compression,+ batch_export_model=BatchExportModel(name="events", schema=None),+ legacy_parquet_extension=legacy_parquet_extension,+ )++ assert run.status == "Completed"++ blobs = [name for name in await list_blobs(azurite_container, blob_prefix) if not name.endswith("manifest.json")]+ assert blobs+ assert all(name.endswith(expected_suffix) for name in blobs), blobs++@pytest.mark.parametrize("interval", ["hour"], indirect=True)@pytest.mark.parametrize("file_format", ["JSONLines"], indirect=True)@pytest.mark.parametrize("compression", [None], indirect=True)diff --git a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/utils.py b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/utils.pyindex afbbfaa4b073..acc35c5d8b3e 100644--- a/products/batch_exports/backend/tests/temporal/destinations/azure_blob/utils.py+++ b/products/batch_exports/backend/tests/temporal/destinations/azure_blob/utils.py@@ -20,13 +20,13 @@ from posthog.temporal.tests.utils.models import afetch_batch_export_runsfrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchemafrom products.batch_exports.backend.temporal.batch_exports import finish_batch_export_run, start_batch_export_runfrom products.batch_exports.backend.temporal.destinations.azure_blob_batch_export import (- FILE_FORMAT_EXTENSIONS,SUPPORTED_COMPRESSIONS,AzureBlobBatchExportInputs,AzureBlobBatchExportWorkflow,azure_blob_default_fields,insert_into_azure_blob_activity_from_stage,)+from products.batch_exports.backend.temporal.destinations.constants import FILE_FORMAT_EXTENSIONSfrom products.batch_exports.backend.temporal.pipeline.internal_stage import insert_into_internal_stage_activityfrom products.batch_exports.backend.temporal.queue import RecordBatchQueuefrom products.batch_exports.backend.temporal.record_batch_model import SessionsRecordBatchModel@@ -289,6 +289,7 @@ async def run_azure_blob_batch_export_workflow(compression: str | None = None,batch_export_model: BatchExportModel | None = None,batch_export_schema: BatchExportSchema | None = None,+ legacy_parquet_extension: bool = True,):"""Run the Azure Blob batch export workflow and return the run result."""workflow_id = str(uuid.uuid4())@@ -301,6 +302,7 @@ async def run_azure_blob_batch_export_workflow(prefix=prefix,file_format=file_format,compression=compression,+ legacy_parquet_extension=legacy_parquet_extension,integration_id=integration_id,batch_export_model=batch_export_model,batch_export_schema=batch_export_schema,diff --git a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_activity.py b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_activity.pyindex 030c5df8caeb..65f7ea932b7c 100644--- a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_activity.py+++ b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_activity.py@@ -156,6 +156,7 @@ async def test_export_to_file_download_bucket_puts_data_into_s3(file_format=file_format,backfill_details=None,sort_key=sort_key,+ legacy_parquet_extension=False,)diff --git a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_workflow.py b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_workflow.pyindex 64013a143eb7..faa85b70a551 100644--- a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_workflow.py+++ b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_workflow.py@@ -170,6 +170,7 @@ async def test_file_download_workflow_exports_data(compression=compression,file_format=file_format,sort_key="uuid",+ legacy_parquet_extension=False,)# Verify BatchExportFileDownload records were created by the workflow.diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/conftest.py b/products/batch_exports/backend/tests/temporal/destinations/s3/conftest.pyindex fd7013916dc0..4013484d6abf 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/conftest.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/conftest.py@@ -86,6 +86,18 @@ def file_format(request) -> str:return f"JSONLines"+def legacy_parquet_extension(request) -> bool:+ """Whether Parquet files keep the compression codec in their extension.++ Defaults to True to match an export whose Temporal schedule predates the setting.+ """+ try:+ return request.param+ except AttributeError:+ return True++@pytest_asyncio.fixtureasync def object_storage_client(bucket_name):"""Manage an S3 client to interact with a local object storage bucket.@@ -132,6 +144,7 @@ async def s3_compatible_batch_export(exclude_events,temporal_client,file_format,+ legacy_parquet_extension,s3_compatible_integration,):destination_data = {@@ -145,6 +158,7 @@ async def s3_compatible_batch_export("compression": compression,"exclude_events": exclude_events,"file_format": file_format,+ "legacy_parquet_extension": legacy_parquet_extension,},}diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.pyindex 11ab09f03c18..6094298c9d3a 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py@@ -8,9 +8,11 @@ from posthog.models.integration import Integration, IntegrationErrorfrom posthog.temporal.tests.utils.events import generate_test_events_in_clickhousefrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchema-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,+)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import (S3InsertInputs,_get_s3_integration,insert_into_s3_activity_from_stage,diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity_with_gcs_bucket.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity_with_gcs_bucket.pyindex 7c4bf983ed57..82a44235b4f1 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity_with_gcs_bucket.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity_with_gcs_bucket.py@@ -10,12 +10,11 @@ from temporalio.testing._activity import ActivityEnvironmentfrom posthog.temporal.tests.utils.events import generate_test_events_in_clickhousefrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchema-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,- S3InsertInputs,- s3_default_fields,)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import S3InsertInputs, s3_default_fieldsfrom products.batch_exports.backend.tests.temporal.destinations.s3.utils import (SPLIT_FILE_FORMAT_COMPRESSIONS,SUPPORTED_FILE_FORMAT_COMPRESSIONS,diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_gcs_bucket.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_gcs_bucket.pyindex 747b0356987a..9f261561756a 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_gcs_bucket.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_gcs_bucket.py@@ -8,11 +8,11 @@ import pytest_asynciofrom posthog.temporal.tests.utils.models import acreate_batch_export, adelete_batch_exportfrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchema-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,- SUPPORTED_COMPRESSIONS,)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import SUPPORTED_COMPRESSIONSfrom products.batch_exports.backend.tests.temporal.destinations.s3.utils import run_s3_batch_export_workflowfrom products.batch_exports.backend.tests.temporal.utils.s3 import delete_all_from_s3diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_local_object_storage.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_local_object_storage.pyindex ac26659fcd12..05a7824fca29 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_local_object_storage.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_local_object_storage.py@@ -100,6 +100,44 @@ async def test_s3_export_workflow_with_local_object_storage_with_various_compres)[email protected]("interval", ["hour"], indirect=True)[email protected]("model", [BatchExportModel(name="events", schema=None)])[email protected]("exclude_events", [None], indirect=True)[email protected]("file_format", ["Parquet"], indirect=True)[email protected]("compression", ["zstd"], indirect=True)[email protected]("legacy_parquet_extension", [True, False], indirect=True)+async def test_s3_export_workflow_names_parquet_files_by_the_extension_setting(+ clickhouse_client,+ object_storage_client,+ ateam,+ s3_compatible_batch_export,+ bucket_name,+ interval,+ compression,+ exclude_events,+ s3_key_prefix,+ file_format,+ legacy_parquet_extension,+ data_interval_start,+ data_interval_end,+ model: BatchExportModel | BatchExportSchema | None,+ generate_test_data,+):+ await run_s3_batch_export_workflow(+ model=model,+ ateam=ateam,+ batch_export_id=str(s3_compatible_batch_export.id),+ integration_id=s3_compatible_batch_export.destination.integration_id,+ s3_destination_config=s3_compatible_batch_export.destination.config,+ interval=interval,+ data_interval_start=data_interval_start,+ data_interval_end=data_interval_end,+ clickhouse_client=clickhouse_client,+ s3_client=object_storage_client,+ destination_type="S3Compatible",+ )++@pytest.mark.parametrize("interval", ["hour"], indirect=True)@pytest.mark.parametrize("compression", [None], indirect=True)@pytest.mark.parametrize("file_format", ["JSONLines"], indirect=True)diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_s3_bucket.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_s3_bucket.pyindex 4951bf83f2f4..093106e800f3 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_s3_bucket.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_workflow_with_s3_bucket.py@@ -10,11 +10,11 @@ from posthog.models.integration import Integrationfrom posthog.temporal.tests.utils.models import acreate_batch_export, adelete_batch_exportfrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchema-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,- SUPPORTED_COMPRESSIONS,)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import SUPPORTED_COMPRESSIONSfrom products.batch_exports.backend.tests.temporal.destinations.s3.utils import (TEST_S3_MODELS,has_valid_credentials,diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/utils.py b/products/batch_exports/backend/tests/temporal/destinations/s3/utils.pyindex 1ee49a79caa0..dca19ba312a3 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/utils.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/utils.py@@ -30,9 +30,11 @@ from products.batch_exports.backend.service import (S3FamilyBaseInputs,)from products.batch_exports.backend.temporal.batch_exports import finish_batch_export_run, start_batch_export_run-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,+)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import (SUPPORTED_COMPRESSIONS,S3BatchExportWorkflow,S3InsertInputs,@@ -216,6 +218,7 @@ async def assert_clickhouse_records_in_s3(backfill_details: BackfillDetails | None = None,allow_duplicates: bool = False,sort_key: str = "uuid",+ legacy_parquet_extension: bool = True,):"""Assert ClickHouse records are written to JSON in key_prefix in S3 bucket_name.@@ -235,6 +238,8 @@ async def assert_clickhouse_records_in_s3(backfill_details: Optional backfill details (this affects the query that is run to get the records).allow_duplicates: If True, allow duplicates when comparing records.sort_key: The key to sort the records by since they are not guaranteed to be in order.+ legacy_parquet_extension: Whether the export keeps the compression codec in the extension+ of a Parquet file."""json_columns = ("properties", "person_properties", "set", "set_once")s3_data = await assert_file_in_s3(@@ -244,6 +249,7 @@ async def assert_clickhouse_records_in_s3(file_format=file_format,compression=compression,json_columns=json_columns,+ legacy_parquet_extension=legacy_parquet_extension,)if batch_export_model is not None:@@ -378,6 +384,7 @@ async def run_s3_batch_export_workflow(exclude_events = s3_destination_config.get("exclude_events", None)file_format = s3_destination_config.get("file_format", "JSONLines")compression = s3_destination_config.get("compression", None)+ legacy_parquet_extension = s3_destination_config.get("legacy_parquet_extension", True)s3_key_prefix = s3_destination_config.get("prefix", None)bucket_name = s3_destination_config.get("bucket_name", None)@@ -472,6 +479,7 @@ async def run_s3_batch_export_workflow(exclude_events=exclude_events,compression=compression,file_format=file_format,+ legacy_parquet_extension=legacy_parquet_extension,sort_key=sort_key,backfill_details=backfill_details,)diff --git a/products/batch_exports/backend/tests/temporal/destinations/test_utils.py b/products/batch_exports/backend/tests/temporal/destinations/test_utils.pyindex 641be208df0a..c50aa050f891 100644--- a/products/batch_exports/backend/tests/temporal/destinations/test_utils.py+++ b/products/batch_exports/backend/tests/temporal/destinations/test_utils.py@@ -2,11 +2,7 @@ import datetime as dtimport pytest-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (- COMPRESSION_EXTENSIONS,- FILE_FORMAT_EXTENSIONS,- S3InsertInputs,-)+from products.batch_exports.backend.temporal.destinations.s3_batch_export import S3InsertInputsfrom products.batch_exports.backend.temporal.destinations.utils import get_object_key, get_query_timeout@@ -211,9 +207,10 @@ base_inputs = {"bucket_name": "test", "region": "test", "team_id": 1}data_interval_end="2023-01-01 01:00:00",compression="gzip",file_format="Parquet",+ legacy_parquet_extension=False,**base_inputs, # type: ignore),- "nested/prefix/2023-01-01 00:00:00-2023-01-01 01:00:00.parquet.gz",+ "nested/prefix/2023-01-01 00:00:00-2023-01-01 01:00:00.parquet",),(S3InsertInputs(@@ -222,9 +219,10 @@ base_inputs = {"bucket_name": "test", "region": "test", "team_id": 1}data_interval_end="2023-01-01 01:00:00",compression="brotli",file_format="Parquet",+ legacy_parquet_extension=False,**base_inputs, # type: ignore),- "nested/prefix/2023-01-01 00:00:00-2023-01-01 01:00:00.parquet.br",+ "nested/prefix/2023-01-01 00:00:00-2023-01-01 01:00:00.parquet",),(S3InsertInputs(@@ -244,8 +242,9 @@ def test_get_object_key(inputs, expected):data_interval_start=inputs.data_interval_start,data_interval_end=inputs.data_interval_end,batch_export_model=inputs.batch_export_model,- file_extension=FILE_FORMAT_EXTENSIONS[inputs.file_format],- compression_extension=COMPRESSION_EXTENSIONS.get(inputs.compression),+ file_format=inputs.file_format,+ compression=inputs.compression,+ legacy_parquet_extension=inputs.legacy_parquet_extension,include_file_number=inputs.max_file_size_mb is not None,)assert result == expecteddiff --git a/products/batch_exports/backend/tests/temporal/utils/s3.py b/products/batch_exports/backend/tests/temporal/utils/s3.pyindex 8a8a71b20f7a..498ac3f7e3b4 100644--- a/products/batch_exports/backend/tests/temporal/utils/s3.py+++ b/products/batch_exports/backend/tests/temporal/utils/s3.py@@ -18,7 +18,7 @@ import botocore.exceptionsfrom pyarrow import fsfrom types_aiobotocore_s3.client import S3Client-from products.batch_exports.backend.temporal.destinations.s3_batch_export import (+from products.batch_exports.backend.temporal.destinations.constants import (COMPRESSION_EXTENSIONS,FILE_FORMAT_EXTENSIONS,)@@ -160,13 +160,23 @@ async def delete_all_from_s3(s3_client, bucket_name: str, key_prefix: str):await s3_client.delete_object(Bucket=bucket_name, Key=obj["Key"])-async def assert_files_in_s3(s3_compatible_client, bucket_name, key_prefix, file_format, compression, json_columns):+async def assert_files_in_s3(+ s3_compatible_client,+ bucket_name,+ key_prefix,+ file_format,+ compression,+ json_columns,+ legacy_parquet_extension=True,+):"""Assert that there are files in S3 under key_prefix and return the combined contents, and the keys of files found."""if file_format == "Arrow":expected_file_extension = "arrow"else:expected_file_extension = FILE_FORMAT_EXTENSIONS[file_format]- if compression is not None:++ keeps_codec_suffix = file_format != "Parquet" or legacy_parquet_extension+ if compression is not None and keeps_codec_suffix:expected_file_extension = f"{expected_file_extension}.{COMPRESSION_EXTENSIONS[compression]}"objects = await s3_compatible_client.list_objects_v2(Bucket=bucket_name, Prefix=key_prefix)@@ -206,10 +216,24 @@ async def assert_files_in_s3(s3_compatible_client, bucket_name, key_prefix, filereturn s3_data, keys-async def assert_file_in_s3(s3_compatible_client, bucket_name, key_prefix, file_format, compression, json_columns):+async def assert_file_in_s3(+ s3_compatible_client,+ bucket_name,+ key_prefix,+ file_format,+ compression,+ json_columns,+ legacy_parquet_extension=True,+):"""Assert a file is in S3 and return its contents."""s3_data, keys = await assert_files_in_s3(- s3_compatible_client, bucket_name, key_prefix, file_format, compression, json_columns+ s3_compatible_client,+ bucket_name,+ key_prefix,+ file_format,+ compression,+ json_columns,+ legacy_parquet_extension=legacy_parquet_extension,)assert len(keys) == 1return s3_datadiff --git a/products/batch_exports/frontend/generated/api.schemas.ts b/products/batch_exports/frontend/generated/api.schemas.tsindex 81b050c374d6..743339e1e94a 100644--- a/products/batch_exports/frontend/generated/api.schemas.ts+++ b/products/batch_exports/frontend/generated/api.schemas.ts@@ -155,6 +155,8 @@ export interface AzureBlobDestinationConfigApi {* @nullable*/max_file_size_mb?: number | null+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: booleantype: AzureBlobDestinationConfigApiType}@@ -246,6 +248,8 @@ export interface AwsS3DestinationConfigApi {* @nullable*/max_file_size_mb?: number | null+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: boolean/*** Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms').* @nullable@@ -299,6 +303,8 @@ export interface S3CompatibleDestinationConfigApi {* @nullable*/max_file_size_mb?: number | null+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: boolean/** Use virtual-hosted-style addressing rather than path-style. */use_virtual_style_addressing?: booleantype: S3CompatibleDestinationConfigApiTypediff --git a/products/batch_exports/frontend/generated/api.zod.ts b/products/batch_exports/frontend/generated/api.zod.tsindex c571d7a304f0..95078f5c3d64 100644--- a/products/batch_exports/frontend/generated/api.zod.ts+++ b/products/batch_exports/frontend/generated/api.zod.ts@@ -119,6 +119,12 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -225,6 +231,12 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -281,6 +293,12 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -815,6 +833,12 @@ export const BatchExportsUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -921,6 +945,12 @@ export const BatchExportsUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -977,6 +1007,12 @@ export const BatchExportsUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -1264,6 +1300,12 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -1372,6 +1414,12 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -1428,6 +1476,12 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -1735,6 +1789,12 @@ export const BatchExportsPauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -1813,6 +1873,12 @@ export const BatchExportsPauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -1859,6 +1925,12 @@ export const BatchExportsPauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -2166,6 +2238,12 @@ export const BatchExportsRunTestStepCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -2252,6 +2330,12 @@ export const BatchExportsRunTestStepCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -2300,6 +2384,12 @@ export const BatchExportsRunTestStepCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -2612,6 +2702,12 @@ export const BatchExportsUnpauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -2692,6 +2788,12 @@ export const BatchExportsUnpauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -2738,6 +2840,12 @@ export const BatchExportsUnpauseCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -3047,6 +3155,12 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),type: zod.enum(['AzureBlob']),}).describe(@@ -3135,6 +3249,12 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -3183,6 +3303,12 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 9d99882e2c72..39d55cabd4bb 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -12157,6 +12157,8 @@ export namespace Schemas {* @nullable*/max_file_size_mb?: number | null;+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: boolean;/*** Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms').* @nullable@@ -12349,6 +12351,8 @@ export namespace Schemas {* @nullable*/max_file_size_mb?: number | null;+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: boolean;type: AzureBlobDestinationConfigType;}@@ -13010,6 +13014,8 @@ export namespace Schemas {* @nullable*/max_file_size_mb?: number | null;+ /** Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension. */+ legacy_parquet_extension?: boolean;/** Use virtual-hosted-style addressing rather than path-style. */use_virtual_style_addressing?: boolean;type: S3CompatibleDestinationConfigType;diff --git a/services/mcp/src/generated/batch_exports/api.ts b/services/mcp/src/generated/batch_exports/api.tsindex c242bffb1c0e..9b24ad28e6ef 100644--- a/services/mcp/src/generated/batch_exports/api.ts+++ b/services/mcp/src/generated/batch_exports/api.ts@@ -138,6 +138,12 @@ export const BatchExportsCreateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),}).describe('Typed configuration for an Azure Blob Storage batch-export destination.\n\nCredentials live in the linked Integration, not in this config. Mirrors\n`AzureBlobBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'@@ -241,6 +247,12 @@ export const BatchExportsCreateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -296,6 +308,12 @@ export const BatchExportsCreateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(@@ -587,6 +605,12 @@ export const BatchExportsPartialUpdateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),}).describe('Typed configuration for an Azure Blob Storage batch-export destination.\n\nCredentials live in the linked Integration, not in this config. Mirrors\n`AzureBlobBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'@@ -692,6 +716,12 @@ export const BatchExportsPartialUpdateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),encryption: zod.string().nullish()@@ -747,6 +777,12 @@ export const BatchExportsPartialUpdateBody = () => zod.describe('If set, rolls to a new file once the current file exceeds this size in MB.'),+ legacy_parquet_extension: zod+ .boolean()+ .optional()+ .describe(+ "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension."+ ),use_virtual_style_addressing: zod.boolean().default(diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.jsonindex 6d6511ae054b..78ef9f5be1cc 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json@@ -81,6 +81,10 @@"enum": ["Parquet", "JSONLines"],"type": "string"},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{@@ -241,6 +245,10 @@],"description": "KMS key ID to use when encryption is 'aws:kms'."},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{@@ -305,6 +313,10 @@"enum": ["Parquet", "JSONLines"],"type": "string"},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.jsonindex 45f08684a4d2..e3d05ca44bbc 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json@@ -80,6 +80,10 @@"enum": ["Parquet", "JSONLines"],"type": "string"},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{@@ -240,6 +244,10 @@],"description": "KMS key ID to use when encryption is 'aws:kms'."},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{@@ -304,6 +312,10 @@"enum": ["Parquet", "JSONLines"],"type": "string"},+ "legacy_parquet_extension": {+ "description": "Whether Parquet files keep the compression codec in their extension, for example '.parquet.zst' rather than '.parquet'. Parquet records its codec inside the file, so new exports leave it out. An export that already wrote Parquet files before this setting existed keeps it, so that pipelines matching on the old names do not break. Has no effect on JSON Lines, which always carries the codec in its extension.",+ "type": "boolean"+ },"max_file_size_mb": {"anyOf": [{