Skip to content

Conversation

tomasfarias
Copy link
Contributor

Problem

Batch exports usage report is out of date.

Changes

  • Removed filter for events model so all models are captured.
  • Excluded HTTP batch exports as we do not have plans to include them in usage calculations.

How did you test this code?

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

* Removed filter for events model so all models are captured.
* Excluded HTTP batch exports as we do not have plans to include them
in usage calculations.
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@tomasfarias tomasfarias requested a review from a team September 3, 2025 16:12
@@ -940,9 +940,9 @@ def get_teams_with_rows_exported_in_period(begin: datetime, end: datetime) -> li
finished_at__gte=begin,
finished_at__lte=end,
status=BatchExportRun.Status.COMPLETED,
batch_export__model=BatchExport.Model.EVENTS,
batch_export__deleted=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this filter is present? Just thinking we could be missing runs executed before a batch export being deleted. Or do you think we don't need to worry about this?

Copy link
Contributor Author

@tomasfarias tomasfarias Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this filter is present?

No idea, I asked in slack about this and seemed like removing it was the way to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking we could be missing runs executed before a batch export being deleted. Or do you think we don't need to worry about this?

How could this happen? Also, why would removing a filter cause us to miss runs? If anything we should be capturing more runs than with the filter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I was referring to the batch_export__deleted=False filter. Not sure what the typical time period is here but just thinking a customer could run a large backfill then delete their batch export

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no clue about that one, I haven't considered it. I guess we need to chat a bit about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, might be a bit of an edge case but won't let it block this PR

Copy link
Contributor

@rossgray rossgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, guess we can discuss the other filter later, shouldn't block this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants