Sentry Issue: [POSTHOG-3ES](https://sentry.io/organizations/posthog/issues/2590699112/?referrer=github_integration)

```
TypeError: '>=' not supported between instances of 'str' and 'int'
  File "posthog/celery.py", line 271, in calculate_cohort
    calculate_cohorts()
  File "posthog/tasks/calculate_cohort.py", line 25, in calculate_cohorts
    Cohort.objects.filter(
  File "django/db/models/query.py", line 296, in __getitem__
    (k.stop is None or k.stop >= 0))), \
```
posthog/settings.py
)
else:
    raise ImproperlyConfigured(
        f'The environment vars "DATABASE_URL" or "POSTHOG_DB_NAME" are absolutely required to run this software'
    )
# Broker
# The last case happens when someone upgrades Heroku but doesn't have Redis installed yet. Collectstatic gets called before we can provision Redis.
if TEST or DEBUG or (len(sys.argv) > 1 and sys.argv[1] == "collectstatic"):
    REDIS_URL = os.getenv("REDIS_URL", "redis://localhost/")
else:
    REDIS_URL = os.getenv("REDIS_URL", "")
if not REDIS_URL and get_from_env("POSTHOG_REDIS_HOST", ""):
    REDIS_URL = "redis://:{}@{}:{}/".format(
        os.getenv("POSTHOG_REDIS_PASSWORD", ""),
        os.getenv("POSTHOG_REDIS_HOST", ""),
        os.getenv("POSTHOG_REDIS_PORT", "6379"),
    )
if not REDIS_URL:
    raise ImproperlyConfigured(
        "Env var REDIS_URL or POSTHOG_REDIS_HOST is absolutely required to run this software.\n"
        "If upgrading from PostHog 1.0.10 or earlier, see here: "
        "https://posthog.com/docs/deployment/upgrading-posthog#upgrading-from-before-1011"
    )
# Only listen to the default queue "celery", unless overridden via the cli
# NB! This is set to explicitly exclude the "posthog-plugins" queue, handled by a nodejs process
CELERY_QUEUES = (Queue("celery", Exchange("celery"), "celery"),)
CELERY_DEFAULT_QUEUE = "celery"
CELERY_IMPORTS = ["posthog.tasks.webhooks"]  # required to avoid circular import
if PRIMARY_DB == RDBMS.CLICKHOUSE:
    try: