Skip to content

Commit

Permalink
fix(exports): Lower the limit further (#20228)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Feb 9, 2024
1 parent 40ed638 commit c4fa55c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions frontend/src/lib/components/ExportButton/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ export async function triggerExport(asset: TriggerExportProps): Promise<void> {

await delay(POLL_DELAY_MS)

// Keep polling for pure network errors like network down, but not any HTTP errors
// Keep polling for pure network errors, but not any HTTP errors
// Example: `NetworkError when attempting to fetch resource`
try {
exportedAsset = await api.exports.get(exportedAsset.id)
} catch (e: any) {
if (e.name === 'NetworkError') {
if (e.name === 'NetworkError' || e.message?.message?.startsWith('NetworkError')) {
continue
}
throw e
Expand Down
2 changes: 1 addition & 1 deletion posthog/tasks/exports/csv_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def make_api_call(

def export_csv(exported_asset: ExportedAsset, limit: Optional[int] = None) -> None:
if not limit:
limit = 500
limit = 200 # Too high limit makes e.g. queries with long breakdown values too long and fail

try:
if exported_asset.export_format != "text/csv":
Expand Down
2 changes: 1 addition & 1 deletion posthog/tasks/exports/test/test_csv_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_csv_exporter_limits_breakdown_insights_correctly(
mocked_request.assert_called_with(
method="get",
url="http://testserver/" + path,
params={"breakdown_limit": 500, "is_csv_export": "1"},
params={"breakdown_limit": 200, "is_csv_export": "1"},
timeout=60,
json=None,
headers=ANY,
Expand Down

0 comments on commit c4fa55c

Please sign in to comment.