:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(filters): Allow more in the type hint (#114067)
Tomás Farías Santana6cf5986cbe9f
diff --git a/products/batch_exports/backend/service.py b/products/batch_exports/backend/service.pyindex 767c935834b2..8a6359238c9d 100644--- a/products/batch_exports/backend/service.py+++ b/products/batch_exports/backend/service.py@@ -140,19 +140,11 @@ class BatchExportSchema(typing.TypedDict):values: dict[str, typing.Any]-@dataclass-class BatchExportEventPropertyFilter:- key: str- operator: str- type: str- value: list[str]--@dataclass(frozen=False)class BatchExportModel:name: strschema: BatchExportSchema | None- filters: list[dict[str, str | bool | list[str] | None]] | None = None+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]] | None = Nonehogql_query: str | None = None# The user who last modified the batch export. This is used for validating custom HogQL queries. This is stored alongside the query, not looked up at runtime, so that an edit during a run cannot pair the old query with a new user.user_id: int | None = Nonediff --git a/products/batch_exports/backend/temporal/filters.py b/products/batch_exports/backend/temporal/filters.pyindex c70ee6cf4beb..6fd166cc9a82 100644--- a/products/batch_exports/backend/temporal/filters.py+++ b/products/batch_exports/backend/temporal/filters.py@@ -45,7 +45,7 @@ class InvalidFilterError(Exception):def compose_filters_clause(- filters: list[dict[str, str | bool | list[str] | None]],+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]],team_id: int,values: dict[str, str] | None = None,) -> tuple[str, dict[str, str]]:diff --git a/products/batch_exports/backend/temporal/pipeline/internal_stage.py b/products/batch_exports/backend/temporal/pipeline/internal_stage.pyindex 14b8933f8460..8c8bfe53db93 100644--- a/products/batch_exports/backend/temporal/pipeline/internal_stage.py+++ b/products/batch_exports/backend/temporal/pipeline/internal_stage.py@@ -415,7 +415,7 @@ async def _stage_query_results(record_batch_model: RecordBatchModel | None,model_name: str,fields: list[BatchExportField] | None,- filters: list[dict[str, str | bool | list[str] | None]] | None,+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]] | None,extra_query_parameters: dict[str, typing.Any] | None,full_range: tuple[dt.datetime | None, dt.datetime | None],s3_staging_folder: S3StagingFolder,@@ -539,7 +539,7 @@ async def _get_query(data_interval_end: str,fields: list[BatchExportField] | None = None,destination_default_fields: list[BatchExportField] | None = None,- filters: list[dict[str, str | bool | list[str] | None]] | None = None,+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]] | None = None,num_partitions: int | None = None,is_workflows: bool = False,**parameters,diff --git a/products/batch_exports/backend/tests/temporal/destinations/test_http_batch_export_workflow.py b/products/batch_exports/backend/tests/temporal/destinations/test_http_batch_export_workflow.pyindex e6fd9dca855e..bb811a285177 100644--- a/products/batch_exports/backend/tests/temporal/destinations/test_http_batch_export_workflow.py+++ b/products/batch_exports/backend/tests/temporal/destinations/test_http_batch_export_workflow.py@@ -85,7 +85,7 @@ async def assert_clickhouse_records_in_mock_server(exclude_events: list[str] | None = None,include_events: list[str] | None = None,backfill_details: BackfillDetails | None = None,- filters: list[dict[str, str | bool | list[str] | None]] | None = None,+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]] | None = None,):"""Assert expected records are written to a MockServer instance."""posted_records = mock_server.recordsdiff --git a/products/batch_exports/backend/tests/temporal/utils/clickhouse_test_producer.py b/products/batch_exports/backend/tests/temporal/utils/clickhouse_test_producer.pyindex ce3fa6673fb0..96cf4261a242 100644--- a/products/batch_exports/backend/tests/temporal/utils/clickhouse_test_producer.py+++ b/products/batch_exports/backend/tests/temporal/utils/clickhouse_test_producer.py@@ -147,7 +147,7 @@ class ClickHouseTestProducer:destination_default_fields: list[BatchExportField] | None = None,max_record_batch_size_bytes: int = 0,min_records_per_batch: int = 100,- filters: list[dict[str, str | bool | list[str] | None]] | None = None,+ filters: list[dict[str, str | bool | float | list[str | bool | float] | None]] | None = None,order_columns: collections.abc.Iterable[str] | None = ("_inserted_at", "event"),is_workflows: bool = False,**parameters,