Skip to content

Commit e0ca5a2

Browse files
author
herve.le-bars
committed
fix: try ignore ruff E501 line too ong with # noqa E501
1 parent 1029ceb commit e0ca5a2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bloom/bloom/infra/repositories/repository_alert.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@ def save_alerts(self, timestamp: datetime) -> None:
2929
FROM spire_vessel_positions WHERE spire_vessel_positions.timestamp >= TIMESTAMP '{timestamp}' - INTERVAL '15 minutes' AND spire_vessel_positions.timestamp < TIMESTAMP '{timestamp}' + INTERVAL '15 minutes' ) AS foo
3030
CROSS JOIN mpa_fr_with_mn WHERE previous_position IS NOT NULL and ST_Contains(mpa_fr_with_mn.geometry,current_position) != ST_Contains(mpa_fr_with_mn.geometry,previous_position) GROUP BY vessel_id, timestamp,cross_mpa
3131
);
32-
""", # nosec: B608
32+
""", # nosec: B608 # noqa: E501
3333
)
3434
session.execute(sql)
3535
session.commit()
3636
return
3737

3838
# an other query with the same result :
3939
# WITH cte_query1 AS (
40-
# SELECT spire_vessel_positions.vessel_id AS vessel_id, ARRAY_AGG(mpa_fr_with_mn.index ORDER BY mpa_fr_with_mn.index DESC) AS mpa_ids
40+
# SELECT spire_vessel_positions.vessel_id AS vessel_id, ARRAY_AGG(mpa_fr_with_mn.index ORDER BY mpa_fr_with_mn.index DESC) AS mpa_ids # noqa: E501
4141
# FROM spire_vessel_positions
42-
# JOIN mpa_fr_with_mn ON ST_Contains(mpa_fr_with_mn.geometry, spire_vessel_positions.position)
43-
# WHERE spire_vessel_positions.timestamp = TO_TIMESTAMP('2023-11-17 12:00', 'YYYY-MM-DD HH24:MI')
42+
# JOIN mpa_fr_with_mn ON ST_Contains(mpa_fr_with_mn.geometry, spire_vessel_positions.position) # noqa: E501
43+
# WHERE spire_vessel_positions.timestamp = TO_TIMESTAMP('2023-11-17 12:00', 'YYYY-MM-DD HH24:MI') # noqa: E501
4444
# GROUP BY vessel_id
4545
# ),
4646
# cte_query2 AS (
47-
# SELECT DISTINCT spire_vessel_positions.vessel_id AS vessel_id, ARRAY_AGG(mpa_fr_with_mn.index ORDER BY mpa_fr_with_mn.index DESC) AS mpa_ids
47+
# SELECT DISTINCT spire_vessel_positions.vessel_id AS vessel_id, ARRAY_AGG(mpa_fr_with_mn.index ORDER BY mpa_fr_with_mn.index DESC) AS mpa_ids # noqa: E501
4848
# FROM spire_vessel_positions
49-
# JOIN mpa_fr_with_mn ON ST_Contains(mpa_fr_with_mn.geometry, spire_vessel_positions.position)
50-
# WHERE spire_vessel_positions.timestamp = TO_TIMESTAMP('2023-11-17 12:15', 'YYYY-MM-DD HH24:MI')
49+
# JOIN mpa_fr_with_mn ON ST_Contains(mpa_fr_with_mn.geometry, spire_vessel_positions.position) # noqa: E501
50+
# WHERE spire_vessel_positions.timestamp = TO_TIMESTAMP('2023-11-17 12:15', 'YYYY-MM-DD HH24:MI') # noqa: E501
5151
# GROUP BY vessel_id
5252
# )
53-
# SELECT vessel_id, mpa_ids, -1 AS value FROM cte_query1 EXCEPT SELECT vessel_id, mpa_ids, -1 AS value FROM cte_query2
53+
# SELECT vessel_id, mpa_ids, -1 AS value FROM cte_query1 EXCEPT SELECT vessel_id, mpa_ids, -1 AS value FROM cte_query2 # noqa: E501
5454
# UNION ALL
55-
# SELECT vessel_id, mpa_ids, 1 AS value FROM cte_query2 EXCEPT SELECT vessel_id, mpa_ids, 1 AS value FROM cte_query1
55+
# SELECT vessel_id, mpa_ids, 1 AS value FROM cte_query2 EXCEPT SELECT vessel_id, mpa_ids, 1 AS value FROM cte_query1 # noqa: E501
5656

5757
def load_alert(self, timestamp: datetime) -> list[Alert]:
5858
with self.session_factory() as session:

0 commit comments

Comments
 (0)