Skip to content

Commit

Permalink
test(batch-exports): Add unit tests for new batch export functions an…
Browse files Browse the repository at this point in the history
…d queue
  • Loading branch information
tomasfarias committed Oct 17, 2024
1 parent f577012 commit 07fe70f
Show file tree
Hide file tree
Showing 2 changed files with 431 additions and 3 deletions.
6 changes: 3 additions & 3 deletions posthog/temporal/batch_exports/batch_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ def start_produce_batch_export_record_batches(
view = SELECT_FROM_PERSONS_VIEW

else:
if parameters["exclude_events"]:
if parameters.get("exclude_events", None):
parameters["exclude_events"] = list(parameters["exclude_events"])
else:
parameters["exclude_events"] = []

if parameters["include_events"]:
if parameters.get("include_events", None):
parameters["include_events"] = list(parameters["include_events"])
else:
parameters["include_events"] = []
Expand All @@ -367,7 +367,7 @@ def start_produce_batch_export_record_batches(
parameters["team_id"] = team_id
parameters["interval_start"] = dt.datetime.fromisoformat(interval_start).strftime("%Y-%m-%d %H:%M:%S")
parameters["interval_end"] = dt.datetime.fromisoformat(interval_end).strftime("%Y-%m-%d %H:%M:%S")
extra_query_parameters = parameters.pop("extra_query_parameters") or {}
extra_query_parameters = parameters.pop("extra_query_parameters", {}) or {}
parameters = {**parameters, **extra_query_parameters}

queue = RecordBatchQueue(max_size_bytes=settings.BATCH_EXPORT_BUFFER_QUEUE_MAX_SIZE_BYTES)
Expand Down
Loading

0 comments on commit 07fe70f

Please sign in to comment.