Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Mar 26, 2024
1 parent 08f27b2 commit 3307e5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion posthog/hogql/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions posthog/hogql/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3307e5f

Please sign in to comment.