From 3307e5f5a6e8a377cb70c289658a3e07888c050d Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 26 Mar 2024 16:03:17 -0400 Subject: [PATCH] types --- posthog/hogql/ast.py | 2 +- posthog/hogql/database/models.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/posthog/hogql/ast.py b/posthog/hogql/ast.py index f0af01ea430eb..793d40e537d30 100644 --- a/posthog/hogql/ast.py +++ b/posthog/hogql/ast.py @@ -309,7 +309,7 @@ class AsteriskType(Type): @dataclass(kw_only=True) class FieldTraverserType(Type): - chain: List[str | int] | List[str] + chain: List[str | int] table_type: TableOrSelectType diff --git a/posthog/hogql/database/models.py b/posthog/hogql/database/models.py index d2da7868a7f9c..9dd75b7be4bfe 100644 --- a/posthog/hogql/database/models.py +++ b/posthog/hogql/database/models.py @@ -65,15 +65,15 @@ class ExpressionField(DatabaseField): class FieldTraverser(FieldOrTable): model_config = ConfigDict(extra="forbid") - chain: List[str] + chain: List[str | int] class Table(FieldOrTable): fields: Dict[str, FieldOrTable] model_config = ConfigDict(extra="forbid") - def has_field(self, name: str) -> bool: - return name in self.fields + def has_field(self, name: str | int) -> bool: + return str(name) in self.fields def get_field(self, name: str) -> FieldOrTable: if self.has_field(name):