Skip to content

Commit

Permalink
chore(data-warehouse): remove explicit integer handling on data wareh…
Browse files Browse the repository at this point in the history
…ouse connected tables (#22055)

* remove explicit integer handling

* update snapshot

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
EDsCODE and github-actions[bot] authored May 3, 2024
1 parent 7ee81e3 commit 95b03f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions posthog/hogql/transforms/property_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from posthog.hogql.database.models import (
DateTimeDatabaseField,
BooleanDatabaseField,
IntegerDatabaseField,
FloatDatabaseField,
)
from posthog.hogql.escape_sql import escape_hogql_identifier
from posthog.hogql.visitor import CloningVisitor, TraversingVisitor
Expand Down Expand Up @@ -152,8 +150,6 @@ def visit_field(self, node: ast.Field):
field_type = node.type.table_type.lazy_join.join_table.fields.get(str(field), None)
prop_type = "String"

if isinstance(field_type, IntegerDatabaseField) or isinstance(field_type, FloatDatabaseField):
prop_type = "Float"
if isinstance(field_type, DateTimeDatabaseField):
prop_type = "DateTime"
if isinstance(field_type, BooleanDatabaseField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# name: TestPropertyTypes.test_data_warehouse_person_property_types
'''

SELECT persons__extended_properties.string_prop AS string_prop, accurateCastOrNull(persons__extended_properties.int_prop, %(hogql_val_6)s) AS int_prop, transform(persons__extended_properties.bool_prop, %(hogql_val_7)s, %(hogql_val_8)s, NULL) AS bool_prop
SELECT persons__extended_properties.string_prop AS string_prop, persons__extended_properties.int_prop AS int_prop, transform(persons__extended_properties.bool_prop, %(hogql_val_6)s, %(hogql_val_7)s, NULL) AS bool_prop
FROM (
SELECT argMax(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person.properties, %(hogql_val_0)s), ''), 'null'), '^"|"$', ''), person.version) AS persons___properties___email, person.id AS id
FROM person
Expand Down

0 comments on commit 95b03f9

Please sign in to comment.