Skip to content

Commit

Permalink
fix: missing join / move second select argument to join
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Feb 16, 2024
1 parent f6b229e commit b2f541b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flexmeasures/cli/data_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ def delete_beliefs( # noqa: C901
entity_filters = []
if sensors:
entity_filters += [TimedBelief.sensor_id.in_([sensor.id for sensor in sensors])]
select_statement = select(TimedBelief)
select_statement = select(TimedBelief).join(Sensor)
if generic_assets:
entity_filters += [
TimedBelief.sensor_id == Sensor.id,
Sensor.generic_asset_id.in_([asset.id for asset in generic_assets]),
]
select_statement = select(TimedBelief, Sensor)
select_statement = select(TimedBelief).join(Sensor)

# Create query
q = select_statement.where(*entity_filters, *event_filters)
Expand Down

0 comments on commit b2f541b

Please sign in to comment.