Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Sep 10, 2024
1 parent 9690e93 commit 1566f8a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/storybook-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
visual-regression:
name: Visual regression tests
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 30
container:
image: mcr.microsoft.com/playwright:v1.45.0
strategy:
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/insights-saved.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ chai.Assertion.addMethod('neverHaveChild', function (childSelector) {
describe('Insights - saved', () => {
it('Data is available immediately', () => {
createInsight('saved insight').then((newInsightId) => {
cy.wait(2000)
cy.get('[data-attr=trend-line-graph]').should('exist') // Results cached
cy.wait(2000)
cy.visit(urls.insightView(newInsightId)) // Full refresh
cy.wait(2000)
cy.get('.InsightViz').should('exist').should('neverHaveChild', '.insight-empty-state') // Only cached data
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/insights/Insight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function Insight({ insightId }: InsightSceneProps): JSX.Element {
<span>You are viewing this insight with filters from a dashboard</span>

<LemonButton type="secondary" to={urls.insightView(insightId as InsightShortId)}>
Remove filters
Discard dashboard filters
</LemonButton>
</div>
</LemonBanner>
Expand Down
10 changes: 6 additions & 4 deletions posthog/api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from posthog.hogql_queries.query_runner import ExecutionMode, execution_mode_from_refresh
from posthog.models.user import User
from posthog.rate_limit import AIBurstRateThrottle, AISustainedRateThrottle, PersonalApiKeyRateThrottle
from posthog.schema import QueryRequest, QueryResponseAlternative, QueryStatusResponse
from posthog.schema import QueryRequest, QueryResponseAlternative, QueryStatusResponse, QuerySchemaRoot
from typing import cast


class QueryThrottle(PersonalApiKeyRateThrottle):
Expand Down Expand Up @@ -72,9 +73,10 @@ def get_throttles(self):
def create(self, request, *args, **kwargs) -> Response:
data = self.get_model(request.data, QueryRequest)
if data.filters_override is not None:
data.query = apply_dashboard_filters_to_dict(
data.query.model_dump(), data.filters_override.model_dump(), self.team
) # type: ignore
data.query = cast(

Check failure on line 76 in posthog/api/query.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Incompatible types in assignment (expression has type "QuerySchemaRoot", variable has type "EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | EventsQuery | <28 more items>")
QuerySchemaRoot,
apply_dashboard_filters_to_dict(data.query.model_dump(), data.filters_override.model_dump(), self.team),
)

client_query_id = data.client_query_id or uuid.uuid4().hex
execution_mode = execution_mode_from_refresh(data.refresh)
Expand Down

0 comments on commit 1566f8a

Please sign in to comment.