Skip to content

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

feat(batch-exports): split file downloads and report exported rows (#98602)

Rosscda5ea67ae14
diff --git a/posthog/settings/batch_exports.py b/posthog/settings/batch_exports.py
index 3c7225057410..7faa27879c05 100644
--- a/posthog/settings/batch_exports.py
+++ b/posthog/settings/batch_exports.py
@@ -150,8 +150,8 @@ BATCH_EXPORT_HOGQL_MAX_EXECUTION_TIME: int = get_from_env(
"BATCH_EXPORT_HOGQL_MAX_EXECUTION_TIME", 900, type_cast=int
) # 15 minutes (deliberately under the file-download stage timeout of 20 minutes)
BATCH_EXPORT_HOGQL_MAX_MEMORY_USAGE: int = get_from_env(
- "BATCH_EXPORT_HOGQL_MAX_MEMORY_USAGE", 50 * 1000 * 1000 * 1000, type_cast=int
-) # 50GB (rather arbitrary for now, can always increase later)
+ "BATCH_EXPORT_HOGQL_MAX_MEMORY_USAGE", 50 * 1024**3, type_cast=int
+) # 50GiB (rather arbitrary for now, can always increase later)
BATCH_EXPORT_HOGQL_MAX_BYTES_TO_READ: int = get_from_env(
- "BATCH_EXPORT_HOGQL_MAX_BYTES_TO_READ", 200 * 1000 * 1000 * 1000, type_cast=int
-) # 200GB (again, rather arbitrary for now)
+ "BATCH_EXPORT_HOGQL_MAX_BYTES_TO_READ", 500 * 1024**3, type_cast=int
+) # 500GiB (again, rather arbitrary for now)
diff --git a/products/batch_exports/backend/api/file_download.py b/products/batch_exports/backend/api/file_download.py
index aca6d1255c6a..7c15b8cfc8d3 100644
--- a/products/batch_exports/backend/api/file_download.py
+++ b/products/batch_exports/backend/api/file_download.py
@@ -53,6 +53,7 @@ from products.batch_exports.backend.temporal.sql.common import get_user_hogql_ba
SESSION = boto3.Session()
FILE_DOWNLOAD_MAX_RANGE = dt.timedelta(weeks=1)
+DEFAULT_MAX_SIZE_MB = 1024
LOGGER = structlog.get_logger(__name__)
_FILE_DOWNLOAD_BATCH_EXPORTS_LOCK_KEY = int.from_bytes(
# 4 ASCII bytes to fill 32-bit PostgreSQL lock key
@@ -83,10 +84,11 @@ class FileDownloadDestinationFileConfigSerializer(serializers.Serializer):
)
max_size_mb = serializers.IntegerField(
required=False,
- default=None,
+ default=DEFAULT_MAX_SIZE_MB,
allow_null=True,
min_value=0,
- help_text="Split download into multiple files of at most this size in MB",
+ help_text="Split the download into files of about this size in MiB. A file can go a little "
+ "over. Set it to null or 0 to write a single file of any size.",
)
@@ -179,7 +181,7 @@ COUNT_ROWS_TIMEOUT_MESSAGE = (
"Timeout exceeded while counting rows. The query may be too complex, or the count may be too "
"large to finish within a short time. Running this query in an export may take too long to "
"complete and/or may produce a very large file to download. Narrow the query with a WHERE "
- "clause to count and export less data if you can't tolerate the additional exeuction time "
+ "clause to count and export less data if you can't tolerate the additional execution time "
"and/or file size."
)
@@ -355,6 +357,10 @@ class RetrieveCompletedOutputSerializer(serializers.Serializer):
status = serializers.ChoiceField(choices=["Completed"])
files = serializers.ListField(child=serializers.UUIDField())
+ records_completed = serializers.IntegerField(
+ allow_null=True,
+ help_text="Number of rows this run exported.",
+ )
class RetrieveFailedOutputSerializer(serializers.Serializer):
@@ -377,6 +383,11 @@ class RetrieveOutputSerializer(serializers.Serializer):
child=serializers.UUIDField(),
required=False,
)
+ records_completed = serializers.IntegerField(
+ required=False,
+ allow_null=True,
+ help_text="Number of rows this run exported.",
+ )
class TooManyConcurrentFileDownloads(APIException):
@@ -534,7 +545,7 @@ class FileDownloadBatchExportOnDemandViewSet(
run_status = batch_export_run.status
- files = {}
+ completed: dict[str, list[str] | int | None] = {}
if run_status == BatchExportRun.Status.COMPLETED:
if batch_export_run.batch_export_on_demand is None:
raise RuntimeError("Batch export on demand must be defined on this run")
@@ -555,9 +566,10 @@ class FileDownloadBatchExportOnDemandViewSet(
# showing running status.
run_status = BatchExportRun.Status.RUNNING
else:
- files["files"] = ids
+ completed["files"] = ids
+ completed["records_completed"] = batch_export_run.records_completed
- return response.Response({"status": run_status, **files, **error})
+ return response.Response({"status": run_status, **completed, **error})
@action(
methods=["GET"], detail=True, url_path=r"download(?:/(?P<part>[^/.]+))?", required_scopes=["batch_export:read"]
diff --git a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_api.py b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_api.py
index 6fc20b465157..a292dcb02cb8 100644
--- a/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_api.py
+++ b/products/batch_exports/backend/tests/temporal/destinations/file_download/test_file_download_api.py
@@ -25,6 +25,7 @@ from posthog.temporal.tests.utils.events import generate_test_events, insert_eve
from products.batch_exports.backend.api.file_download import (
COUNT_ROWS_TIMEOUT_MESSAGE,
+ DEFAULT_MAX_SIZE_MB,
_calculate_expiration_for_file_download,
_generate_s3_pre_signed_url,
_get_file_download_for_run,
@@ -187,6 +188,7 @@ async def test_file_download_retrieve_returns_error(
assert data["status"] == "Failed", status_response.json()
assert data.get("error", None) is not None
assert data["error"] == "some error message"
+ assert "records_completed" not in data
@pytest.mark.django_db(transaction=True)
@@ -208,6 +210,7 @@ async def test_file_download_retrieve_returns_files(
data_interval_start=data_interval_start,
data_interval_end=data_interval_end,
status=BatchExportRun.Status.COMPLETED,
+ records_completed=1234,
)
file_downloads = []
@@ -227,6 +230,7 @@ async def test_file_download_retrieve_returns_files(
data = status_response.json()
assert data["status"] == "Completed", status_response.json()
assert data["files"] == [str(file_download.id) for file_download in file_downloads]
+ assert data["records_completed"] == 1234
@pytest.mark.django_db(transaction=True)
@@ -806,6 +810,7 @@ class TestFileDownloadHogQL:
batch_export_model = mock_start_file_download_export.call_args.kwargs["batch_export_model"]
assert batch_export_model.name == "hogql"
assert batch_export_model.hogql_query == hogql_query
+ assert mock_start_file_download_export.call_args.kwargs["max_size_mb"] == DEFAULT_MAX_SIZE_MB
@pytest.mark.usefixtures("override_file_download_settings", "enable_hogql_flag")
@pytest.mark.django_db(transaction=True)
diff --git a/products/batch_exports/frontend/generated/api.schemas.ts b/products/batch_exports/frontend/generated/api.schemas.ts
index 8f2298f212a1..e7331c8fcbad 100644
--- a/products/batch_exports/frontend/generated/api.schemas.ts
+++ b/products/batch_exports/frontend/generated/api.schemas.ts
@@ -1703,7 +1703,7 @@ export interface FileDownloadDestinationFileConfigApi {
* * `snappy` - snappy */
compression?: CompressionEnumApi | null
/**
- * Split download into multiple files of at most this size in MB
+ * Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.
* @minimum 0
* @nullable
*/
@@ -1822,6 +1822,11 @@ export const RetrieveCompletedOutputApiStatus = {
export interface RetrieveCompletedOutputApi {
status: RetrieveCompletedOutputApiStatus
files: string[]
+ /**
+ * Number of rows this run exported.
+ * @nullable
+ */
+ records_completed: number | null
}
export type RetrieveFailedOutputApiStatus =
diff --git a/products/batch_exports/frontend/generated/api.zod.ts b/products/batch_exports/frontend/generated/api.zod.ts
index e81a7f71f829..bf10aab32bf1 100644
--- a/products/batch_exports/frontend/generated/api.zod.ts
+++ b/products/batch_exports/frontend/generated/api.zod.ts
@@ -3377,15 +3377,19 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod
* Create and start a batch export on demand run to download a file.
*/
export const fileDownloadBatchExportsCreateBodyOneFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyTwoFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyThreeFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyFourFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbMin = 0
export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
@@ -3415,7 +3419,10 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['events']),
@@ -3451,7 +3458,10 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['persons']),
@@ -3485,7 +3495,10 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['sessions']),
@@ -3519,7 +3532,10 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['hogql']),
@@ -3536,6 +3552,7 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([
* Cancel an ongoing file-download batch export.
*/
export const fileDownloadBatchExportsCancelCreateBodyFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbMin = 0
export const FileDownloadBatchExportsCancelCreateBody = /* @__PURE__ */ zod
@@ -3564,7 +3581,10 @@ export const FileDownloadBatchExportsCancelCreateBody = /* @__PURE__ */ zod
.number()
.min(fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod
diff --git a/products/batch_exports/mcp/tools.yaml b/products/batch_exports/mcp/tools.yaml
index 1144ebadce98..967e00fea572 100644
--- a/products/batch_exports/mcp/tools.yaml
+++ b/products/batch_exports/mcp/tools.yaml
@@ -228,9 +228,11 @@ tools:
hogql_query instead of a data interval, and returns a permission error naming HogQL batch exports when the
team does not have it enabled, in which case tell the user they can contact PostHog support to request
access. Limit hogql_query with a WHERE clause to export only the data the user asked for, because user
- queries run under stricter resource limits than the other models. Use file-download-batch-exports-retrieve
- with the returned id to poll until status is Completed, then follow the downloading-batch-export-files skill
- to download the files through the existing REST download endpoint.
+ queries run under stricter resource limits than the other models. The export splits into files of about 1024
+ MiB by default, and a file can go a little over; set file.max_size_mb to change that size, or to null to
+ write a single file of any size. Use file-download-batch-exports-retrieve with the returned id to poll until
+ status is Completed, then follow the downloading-batch-export-files skill to download the files through the
+ existing REST download endpoint.
file-download-batch-exports-download-retrieve:
operation: file_download_batch_exports_download_retrieve
enabled: false
@@ -252,7 +254,8 @@ tools:
title: Get file download export status
description: >
Get the status of an on-demand file download export. Returns Starting or Running while the export is in
- progress, Completed with file IDs when files are ready, or a failed status with an error message. When
- status is Completed, use the downloading-batch-export-files skill to download each file through the existing
- REST download endpoint; the generated MCP download operation is intentionally not enabled because it is a
- redirect to the file body.
+ progress, Completed with file IDs when files are ready, or a failed status with an error message. A
+ Completed response also reports records_completed, the number of rows the run exported; report that count to
+ the user. When status is Completed, use the downloading-batch-export-files skill to download each file
+ through the existing REST download endpoint; the generated MCP download operation is intentionally not
+ enabled because it is a redirect to the file body.
diff --git a/products/batch_exports/skills/downloading-batch-export-files/SKILL.md b/products/batch_exports/skills/downloading-batch-export-files/SKILL.md
index 161e4c98b96d..3ffb35bf0188 100644
--- a/products/batch_exports/skills/downloading-batch-export-files/SKILL.md
+++ b/products/batch_exports/skills/downloading-batch-export-files/SKILL.md
@@ -33,7 +33,8 @@ Ask a short clarifying question if the user did not specify the required inputs:
Required for `events`, `persons`, and `sessions`, and not supported for `hogql`
- `file.format`: `Parquet` or `JSONLines`; prefer `Parquet` for compact analytics exports and `JSONLines` for line-oriented text processing
- `file.compression`: optional, one of `zstd`, `gzip`, `brotli`, `lz4`, or `snappy`. If `JSONLines` was chosen as format, only `gzip` and `brotli` are supported.
-- `file.max_size_mb`: optional maximum part size in MB; set this when the user wants multiple smaller files instead of a single (potentially large) file.
+- `file.max_size_mb`: part size in MiB, 1024 by default. A part can go a little over this size.
+ Lower it when the user wants smaller parts, raise it for fewer and bigger ones, or set it to `null` to write a single file of any size.
For `events`, `include` and `exclude` are optional event-name filters.
Use them only when the user asks for specific events or wants to omit specific events.
@@ -94,6 +95,9 @@ When `Completed`, the `files` array contains file UUIDs.
For single-file exports it usually contains one UUID.
For split exports, download every UUID unless the user asked for a specific part.
+A `Completed` response also carries `records_completed`, the number of rows the run exported.
+Report it to the user, because the count is otherwise only visible by opening every file.
+
### 4. Optionally, cancel a running export
If required by the user, a running export can be cancelled by calling `posthog:file-download-batch-exports-cancel-create` with the returned `id`.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index d133d04db48b..ed7bb34afc63 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -5740,7 +5740,7 @@
}
},
"file-download-batch-exports-create": {
- "description": "Start an on-demand batch export that prepares downloadable files for events, persons, sessions, or the results of a HogQL query. For events, persons and sessions, provide data_interval_start and data_interval_end as ISO 8601 datetimes; the interval must be at most one week, and for events, include and exclude filter event names. The hogql model is in closed beta and is enabled per team: it takes a hogql_query instead of a data interval, and returns a permission error naming HogQL batch exports when the team does not have it enabled, in which case tell the user they can contact PostHog support to request access. Limit hogql_query with a WHERE clause to export only the data the user asked for, because user queries run under stricter resource limits than the other models. Use file-download-batch-exports-retrieve with the returned id to poll until status is Completed, then follow the downloading-batch-export-files skill to download the files through the existing REST download endpoint.",
+ "description": "Start an on-demand batch export that prepares downloadable files for events, persons, sessions, or the results of a HogQL query. For events, persons and sessions, provide data_interval_start and data_interval_end as ISO 8601 datetimes; the interval must be at most one week, and for events, include and exclude filter event names. The hogql model is in closed beta and is enabled per team: it takes a hogql_query instead of a data interval, and returns a permission error naming HogQL batch exports when the team does not have it enabled, in which case tell the user they can contact PostHog support to request access. Limit hogql_query with a WHERE clause to export only the data the user asked for, because user queries run under stricter resource limits than the other models. The export splits into files of about 1024 MiB by default, and a file can go a little over; set file.max_size_mb to change that size, or to null to write a single file of any size. Use file-download-batch-exports-retrieve with the returned id to poll until status is Completed, then follow the downloading-batch-export-files skill to download the files through the existing REST download endpoint.",
"category": "Data pipelines",
"feature": "batch_exports",
"summary": "Start file download export",
@@ -5754,7 +5754,7 @@
}
},
"file-download-batch-exports-retrieve": {
- "description": "Get the status of an on-demand file download export. Returns Starting or Running while the export is in progress, Completed with file IDs when files are ready, or a failed status with an error message. When status is Completed, use the downloading-batch-export-files skill to download each file through the existing REST download endpoint; the generated MCP download operation is intentionally not enabled because it is a redirect to the file body.",
+ "description": "Get the status of an on-demand file download export. Returns Starting or Running while the export is in progress, Completed with file IDs when files are ready, or a failed status with an error message. A Completed response also reports records_completed, the number of rows the run exported; report that count to the user. When status is Completed, use the downloading-batch-export-files skill to download each file through the existing REST download endpoint; the generated MCP download operation is intentionally not enabled because it is a redirect to the file body.",
"category": "Data pipelines",
"feature": "batch_exports",
"summary": "Get file download export status",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index e59f28875184..01cd29906b09 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -5909,7 +5909,7 @@
}
},
"file-download-batch-exports-create": {
- "description": "Start an on-demand batch export that prepares downloadable files for events, persons, sessions, or the results of a HogQL query. For events, persons and sessions, provide data_interval_start and data_interval_end as ISO 8601 datetimes; the interval must be at most one week, and for events, include and exclude filter event names. The hogql model is in closed beta and is enabled per team: it takes a hogql_query instead of a data interval, and returns a permission error naming HogQL batch exports when the team does not have it enabled, in which case tell the user they can contact PostHog support to request access. Limit hogql_query with a WHERE clause to export only the data the user asked for, because user queries run under stricter resource limits than the other models. Use file-download-batch-exports-retrieve with the returned id to poll until status is Completed, then follow the downloading-batch-export-files skill to download the files through the existing REST download endpoint.",
+ "description": "Start an on-demand batch export that prepares downloadable files for events, persons, sessions, or the results of a HogQL query. For events, persons and sessions, provide data_interval_start and data_interval_end as ISO 8601 datetimes; the interval must be at most one week, and for events, include and exclude filter event names. The hogql model is in closed beta and is enabled per team: it takes a hogql_query instead of a data interval, and returns a permission error naming HogQL batch exports when the team does not have it enabled, in which case tell the user they can contact PostHog support to request access. Limit hogql_query with a WHERE clause to export only the data the user asked for, because user queries run under stricter resource limits than the other models. The export splits into files of about 1024 MiB by default, and a file can go a little over; set file.max_size_mb to change that size, or to null to write a single file of any size. Use file-download-batch-exports-retrieve with the returned id to poll until status is Completed, then follow the downloading-batch-export-files skill to download the files through the existing REST download endpoint.",
"category": "Data pipelines",
"feature": "batch_exports",
"summary": "Start file download export",
@@ -5923,7 +5923,7 @@
}
},
"file-download-batch-exports-retrieve": {
- "description": "Get the status of an on-demand file download export. Returns Starting or Running while the export is in progress, Completed with file IDs when files are ready, or a failed status with an error message. When status is Completed, use the downloading-batch-export-files skill to download each file through the existing REST download endpoint; the generated MCP download operation is intentionally not enabled because it is a redirect to the file body.",
+ "description": "Get the status of an on-demand file download export. Returns Starting or Running while the export is in progress, Completed with file IDs when files are ready, or a failed status with an error message. A Completed response also reports records_completed, the number of rows the run exported; report that count to the user. When status is Completed, use the downloading-batch-export-files skill to download each file through the existing REST download endpoint; the generated MCP download operation is intentionally not enabled because it is a redirect to the file body.",
"category": "Data pipelines",
"feature": "batch_exports",
"summary": "Get file download export status",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 3f9b9e60befd..2529e5589c36 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -20497,7 +20497,7 @@ export namespace Schemas {
* * `snappy` - snappy */
compression?: CompressionEnum | null;
/**
- * Split download into multiple files of at most this size in MB
+ * Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.
* @minimum 0
* @nullable
*/
@@ -78380,6 +78380,11 @@ export namespace Schemas {
export interface RetrieveCompletedOutput {
status: RetrieveCompletedOutputStatus;
files: string[];
+ /**
+ * Number of rows this run exported.
+ * @nullable
+ */
+ records_completed: number | null;
}
/**
diff --git a/services/mcp/src/generated/batch_exports/api.ts b/services/mcp/src/generated/batch_exports/api.ts
index d3f7978eb547..5be113e71eb8 100644
--- a/services/mcp/src/generated/batch_exports/api.ts
+++ b/services/mcp/src/generated/batch_exports/api.ts
@@ -936,15 +936,19 @@ export const FileDownloadBatchExportsCreateParams = () => zod.object({
})
export const fileDownloadBatchExportsCreateBodyOneFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyTwoFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyThreeFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbMin = 0
export const fileDownloadBatchExportsCreateBodyFourFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbMin = 0
export const FileDownloadBatchExportsCreateBody = () => zod.union([
@@ -974,7 +978,10 @@ export const FileDownloadBatchExportsCreateBody = () => zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyOneFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['events']),
@@ -1010,7 +1017,10 @@ export const FileDownloadBatchExportsCreateBody = () => zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyTwoFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['persons']),
@@ -1044,7 +1054,10 @@ export const FileDownloadBatchExportsCreateBody = () => zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyThreeFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['sessions']),
@@ -1078,7 +1091,10 @@ export const FileDownloadBatchExportsCreateBody = () => zod.union([
.number()
.min(fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCreateBodyFourFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod.enum(['hogql']),
@@ -1120,6 +1136,7 @@ export const FileDownloadBatchExportsCancelCreateParams = () => zod.object({
})
export const fileDownloadBatchExportsCancelCreateBodyFileFormatDefault = `Parquet`
+export const fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbDefault = 1024
export const fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbMin = 0
export const FileDownloadBatchExportsCancelCreateBody = () => zod
@@ -1148,7 +1165,10 @@ export const FileDownloadBatchExportsCancelCreateBody = () => zod
.number()
.min(fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbMin)
.nullish()
- .describe('Split download into multiple files of at most this size in MB'),
+ .default(fileDownloadBatchExportsCancelCreateBodyFileMaxSizeMbDefault)
+ .describe(
+ 'Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size.'
+ ),
})
.describe('Typed configuration for a FileDownload batch-export destination.'),
model: zod
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json
index dc5a527b3ea7..1f4f2f971f6c 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json
@@ -51,7 +51,8 @@
"type": "null"
}
],
- "description": "Split download into multiple files of at most this size in MB"
+ "default": 1024,
+ "description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json
index d5d30ca51789..bbb47e5590e4 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json
@@ -52,7 +52,8 @@
"type": "null"
}
],
- "description": "Split download into multiple files of at most this size in MB"
+ "default": 1024,
+ "description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
@@ -116,7 +117,8 @@
"type": "null"
}
],
- "description": "Split download into multiple files of at most this size in MB"
+ "default": 1024,
+ "description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
@@ -174,7 +176,8 @@
"type": "null"
}
],
- "description": "Split download into multiple files of at most this size in MB"
+ "default": 1024,
+ "description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"
@@ -222,7 +225,8 @@
"type": "null"
}
],
- "description": "Split download into multiple files of at most this size in MB"
+ "default": 1024,
+ "description": "Split the download into files of about this size in MiB. A file can go a little over. Set it to null or 0 to write a single file of any size."
}
},
"type": "object"