@@ -171,6 +171,49 @@ async def test_analyse_csv_send_udata_webhook(
171171 assert webhook .get (f"analysis:parsing:{ k } " , False ) is None
172172
173173
174+ async def test_analyse_csv_enqueues_export_jobs_on_low_queue (
175+ mocker , setup_catalog , rmock , catalog_content , db , fake_check , produce_mock
176+ ):
177+ """Parquet export is scheduled on the low RQ queue (CSV geo export disabled)."""
178+ import asyncio
179+
180+ recorded : list [tuple [object , str | None ]] = []
181+
182+ async def tracking_parquet_export (* args , ** kwargs ):
183+ pass
184+
185+ mocker .patch ("udata_hydra.analysis.csv.export_parquet" , tracking_parquet_export )
186+
187+ def capture_enqueue (fn , * args , ** kwargs ):
188+ recorded .append ((fn , kwargs .get ("_priority" )))
189+ kwargs = dict (kwargs )
190+ kwargs .pop ("_priority" , None )
191+ kwargs .pop ("_exception" , None )
192+ result = fn (* args , ** kwargs )
193+ if asyncio .iscoroutine (result ):
194+ loop = asyncio .get_running_loop ()
195+ return loop .run_until_complete (result )
196+ return result
197+
198+ mocker .patch ("udata_hydra.utils.queue.enqueue" , capture_enqueue )
199+
200+ check = await fake_check ()
201+ url = check ["url" ]
202+ rmock .get (url , status = 200 , body = catalog_content )
203+ with (
204+ patch ("udata_hydra.config.DB_TO_PARQUET" , True ),
205+ patch ("udata_hydra.config.MIN_LINES_FOR_PARQUET" , 1 ),
206+ patch ("udata_hydra.config.DB_TO_GEOJSON" , False ),
207+ ):
208+ await analyse_csv (check = check )
209+
210+ assert any (f is tracking_parquet_export and p == "low" for f , p in recorded )
211+
212+ from udata_hydra .analysis .exports import export_geojson_pmtiles as exp_geo
213+
214+ assert not any (f is exp_geo for f , _ in recorded )
215+
216+
174217@pytest .mark .parametrize (
175218 "forced_analysis" ,
176219 (
0 commit comments