Sentry Issue: [POSTHOG-EU-3YC](https://posthog.sentry.io/issues/4121292376/?referrer=github_integration)

```
ServerException: Code: 53.
DB::Exception: Cannot convert string true to type UInt8: while executing 'FUNCTION equals(equals(replaceRegexpAll(JSONExtractRaw(properties, 'metadata.isApp'), '^"|"$', ''), 'true') : 30, 'true' : 16) -> equals(equals(replaceRegexpAll(JSONExtractRaw(properties, 'metadata.isApp'), '^"|"$', ''), 'true'), 'true') UInt8 : 31'. Stack trace:

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8e2df48 in /usr/bin/clickhouse
1. DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(int, fmt::v8::basic_format_string<char, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::type, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::type>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) @ 0xae40760 in /usr/bin/clickhouse
2. ? @ 0x11e833ac in /usr/bin/clickhouse
3. DB::FunctionComparison<DB::EqualsOp, DB::NameEquals>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0xc621128 in /usr/bin/clickhouse
4. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c99c9c in /usr/bin/clickhouse
5. DB::IExecutableFunction::executeWithoutSparseColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c9a574 in /usr/bin/clickhouse
6. DB::IExecutableFunction::execute(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c9bb7c in /usr/bin/clickhouse
7. DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool) const @ 0x117f49d8 in /usr/bin/clickhouse
8. DB::ExpressionActions::execute(DB::Block&, bool) const @ 0x117f5930 in /usr/bin/clickhouse
9. DB::ExpressionAnalysisResult::ExpressionAnalysisResult(DB::SelectQueryExpressionAnalyzer&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, bool, bool, bool, std::__1::shared_ptr<DB::FilterDAGInfo> const&, std::__1::shared_ptr<DB::FilterDAGInfo> const&, DB::Block const&) @ 0x1186417c in /usr/bin/clickhouse
10. DB::InterpreterSelectQuery::getSampleBlockImpl() @ 0x11bb4000 in /usr/bin/clickhouse
11. ? @ 0x11bacdd8 in /usr/bin/clickhouse
12. DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::shared_ptr<DB::PreparedSets>) @ 0x11ba84ec in /usr/bin/clickhouse
13. DB::InterpreterSelectWithUnionQuery::buildCurrentChildInterpreter(std::__1::shared_ptr<DB::IAST> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x11bee304 in /usr/bin/clickhouse
14. DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x11bec654 in /usr/bin/clickhouse
15. DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x11b5d12c in /usr/bin/clickhouse
16. ? @ 0x11e9e7bc in /usr/bin/clickhouse
17. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x11e9c59c in /usr/bin/clickhouse
18. DB::TCPHandler::runImpl() @ 0x12835ec4 in /usr/bin/clickhouse
19. DB::TCPHandler::run() @ 0x128480a4 in /usr/bin/clickhouse
20. Poco::Net::TCPServerConnection::start() @ 0x134653c0 in /usr/bin/clickhouse
21. Poco::Net::TCPServerDispatcher::run() @ 0x13466938 in /usr/bin/clickhouse
22. Poco::PooledThread::run() @ 0x1364f150 in /usr/bin/clickhouse
23. Poco::ThreadImpl::runnableEntry(void*) @ 0x1364cae4 in /usr/bin/clickhouse
24. start_thread @ 0x7624 in /usr/lib/aarch64-linux-gnu/libpthread-2.31.so
25. ? @ 0xd149c in /usr/lib/aarch64-linux-gnu/libc-2.31.so

(2 additional frame(s) were not displayed)
...
  File "clickhouse_driver/client.py", line 491, in process_ordinary_query
    return self.receive_result(with_column_types=with_column_types,
  File "clickhouse_driver/client.py", line 151, in receive_result
    return result.get_result()
  File "clickhouse_driver/result.py", line 50, in get_result
    for packet in self.packet_generator:
  File "clickhouse_driver/client.py", line 167, in packet_generator
    packet = self.receive_packet()
  File "clickhouse_driver/client.py", line 184, in receive_packet
    raise packet.exception

CHQueryErrorTypeMismatch: Code: 53.
DB::Exception: Cannot convert string true to type UInt8: while executing 'FUNCTION equals(equals(replaceRegexpAll(JSONExtractRaw(properties, 'metadata.isApp'), '^"|"$', ''), 'true') : 30, 'true' : 16) -> equals(equals(replaceRegexpAll(JSONExtractRaw(properties, 'metadata.isApp'), '^"|"$', ''), 'true'), 'true') UInt8 : 31'. Stack trace:

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8e2df48 in /usr/bin/clickhouse
1. DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(int, fmt::v8::basic_format_string<char, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::type, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::type>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) @ 0xae40760 in /usr/bin/clickhouse
2. ? @ 0x11e833ac in /usr/bin/clickhouse
3. DB::FunctionComparison<DB::EqualsOp, DB::NameEquals>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0xc621128 in /usr/bin/clickhouse
4. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c99c9c in /usr/bin/clickhouse
5. DB::IExecutableFunction::executeWithoutSparseColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c9a574 in /usr/bin/clickhouse
6. DB::IExecutableFunction::execute(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x10c9bb7c in /usr/bin/clickhouse
7. DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool) const @ 0x117f49d8 in /usr/bin/clickhouse
8. DB::ExpressionActions::execute(DB::Block&, bool) const @ 0x117f5930 in /usr/bin/clickhouse
9. DB::ExpressionAnalysisResult::ExpressionAnalysisResult(DB::SelectQueryExpressionAnalyzer&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, bool, bool, bool, std::__1::shared_ptr<DB::FilterDAGInfo> const&, std::__1::shared_ptr<DB::FilterDAGInfo> const&, DB::Block const&) @ 0x1186417c in /usr/bin/clickhouse
10. DB::InterpreterSelectQuery::getSampleBlockImpl() @ 0x11bb4000 in /usr/bin/clickhouse
11. ? @ 0x11bacdd8 in /usr/bin/clickhouse
12. DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::shared_ptr<DB::PreparedSets>) @ 0x11ba84ec in /usr/bin/clickhouse
13. DB::InterpreterSelectWithUnionQuery::buildCurrentChildInterpreter(std::__1::shared_ptr<DB::IAST> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x11bee304 in /usr/bin/clickhouse
14. DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x11bec654 in /usr/bin/clickhouse
15. DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x11b5d12c in /usr/bin/clickhouse
16. ? @ 0x11e9e7bc in /usr/bin/clickhouse
17. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x11e9c59c in /usr/bin/clickhouse
18. DB::TCPHandler::runImpl() @ 0x12835ec4 in /usr/bin/clickhouse
19. DB::TCPHandler::run() @ 0x128480a4 in /usr/bin/clickhouse
20. Poco::Net::TCPServerConnection::start() @ 0x134653c0 in /usr/bin/clickhouse
21. Poco::Net::TCPServerDispatcher::run() @ 0x13466938 in /usr/bin/clickhouse
22. Poco::PooledThread::run() @ 0x1364f150 in /usr/bin/clickhouse
23. Poco::ThreadImpl::runnableEntry(void*) @ 0x1364cae4 in /usr/bin/clickhouse
24. start_thread @ 0x7624 in /usr/lib/aarch64-linux-gnu/libpthread-2.31.so
25. ? @ 0xd149c in /usr/lib/aarch64-linux-gnu/libc-2.31.so

(3 additional frame(s) were not displayed)
...
  File "posthog/models/event/events_query.py", line 142, in run_events_query
    query_result = execute_hogql_query(query=stmt, team=team, workload=Workload.OFFLINE, query_type="EventsQuery")
  File "posthog/hogql/query.py", line 77, in execute_hogql_query
    results, types = insight_sync_execute(
  File "posthog/queries/insight.py", line 12, in insight_sync_execute
    return sync_execute(query, args=args, **kwargs)
  File "posthog/utils.py", line 1257, in inner
    return inner._impl(*args, **kwargs)  # type: ignore
  File "posthog/clickhouse/client/execute.py", line 111, in sync_execute
    raise err
```
posthog/hogql/property.py
elif isinstance(property, BaseModel):
        property = Property(**property.dict())
    else:
        raise NotImplementedException(
            f"property_to_expr with property of type {type(property).__name__} not implemented"
        )
    if property.type == "hogql":
        return parse_expr(property.key)
    elif property.type == "event" or cast(Any, property.type) == "feature" or property.type == "person":
        operator = cast(Optional[PropertyOperator], property.operator) or PropertyOperator.exact
        value = property.value
        if isinstance(value, list):
            if len(value) == 1:
                value = value[0]
            else:
                exprs = [
                    property_to_expr(
                        Property(type=property.type, key=property.key, operator=property.operator, value=v), team
                    )
                    for v in value
                ]
                if (
                    operator == PropertyOperator.is_not
                    or operator == PropertyOperator.not_icontains
                    or operator == PropertyOperator.not_regex
                ):
                    return ast.And(exprs=exprs)
                return ast.Or(exprs=exprs)
        chain = ["person", "properties"] if property.type == "person" else ["properties"]
        field = ast.Field(chain=chain + [property.key])