Skip to content

Commit

Permalink
Use the right CacheMissResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Apr 24, 2024
1 parent d54e156 commit faae75c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions posthog/api/services/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
from pydantic import BaseModel
from rest_framework.exceptions import ValidationError

from posthog.caching.fetch_from_cache import NothingInCacheResult
from posthog.clickhouse.query_tagging import tag_queries
from posthog.hogql.constants import LimitContext
from posthog.hogql.context import HogQLContext
from posthog.hogql.database.database import create_hogql_database, serialize_database
from posthog.hogql.autocomplete import get_hogql_autocomplete
from posthog.hogql.metadata import get_hogql_metadata
from posthog.hogql.modifiers import create_default_modifiers_for_team
from posthog.hogql_queries.query_runner import ExecutionMode, get_query_runner
from posthog.hogql_queries.query_runner import CacheMissResponse, ExecutionMode, get_query_runner
from posthog.models import Team
from posthog.queries.time_to_see_data.serializers import SessionEventsQuerySerializer, SessionsQuerySerializer
from posthog.queries.time_to_see_data.sessions import get_session_events, get_sessions
Expand Down Expand Up @@ -86,7 +85,7 @@ def process_query_model(
if execution_mode == ExecutionMode.CACHE_ONLY_NEVER_CALCULATE and not isinstance(

Check failure on line 85 in posthog/api/services/query.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Parameterized generics cannot be used with class or instance checks
query, QUERY_WITH_RUNNER_USING_CACHE

Check failure on line 86 in posthog/api/services/query.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument 2 to "isinstance" has incompatible type "<typing special form>"; expected "_ClassInfo"
):
result = NothingInCacheResult()
result = CacheMissResponse()

Check failure on line 88 in posthog/api/services/query.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Missing named argument "cache_key" for "CacheMissResponse"

if isinstance(query, QUERY_WITH_RUNNER_USING_CACHE): # type: ignore
query_runner = get_query_runner(query, team, limit_context=limit_context)
Expand Down

0 comments on commit faae75c

Please sign in to comment.