Skip to content

Commit

Permalink
fix: psql facts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats E. Mollestad committed Nov 2, 2023
1 parent 4008190 commit 55ec095
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aligned/psql/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def sql_aggregated_request(
id_column = 'row_id'
# id_column = window.group_by[0].name
event_timestamp_clause: str | None = None
if request.event_timestamp_request:
if request.event_timestamp_request and request.event_timestamp_request.entity_column:
timestamp = request.event_timestamp_request.event_timestamp
entity_column = request.event_timestamp_request.entity_column
group_by_names = {id_column}
Expand Down Expand Up @@ -490,7 +490,7 @@ def build_request_from_facts(self, facts: pl.LazyFrame) -> str:
entity_types[entity.name] = entity.dtype
all_entities.add(entity.name)

if request.event_timestamp_request:
if request.event_timestamp_request and request.event_timestamp_request.entity_column:
entity_column = request.event_timestamp_request.entity_column
has_event_timestamp = True
entity_types[entity_column] = FeatureType('').datetime
Expand Down Expand Up @@ -657,7 +657,7 @@ def build_sql_entity_query(self, sql_facts: PostgreSqlJob) -> str:
final_select_names = final_select_names.union(
{f'entities.{entity}' for entity in request.entity_names}
)
if request.event_timestamp_request:
if request.event_timestamp_request and request.event_timestamp_request.entity_column:
entity_column = request.event_timestamp_request.entity_column

if entity_column in sql_facts.query:
Expand Down

0 comments on commit 55ec095

Please sign in to comment.