before output type Used above Used above Managing all output in save final without adding information in the mtr_datou_result ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640573', None, None, None, None, None, '2761189') ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640516', None, None, None, None, None, '2761189') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 6 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', '22421455', '1353640573', '0.0', None, None, None, None, '2761189'), ('4302', '22421455', '1353640516', '0.0', None, None, None, None, '2761189')] time used for this insertion : 0.11158537864685059 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.15091657638549805 time spend to save output : 0.11181259155273438 total time spend for step 2 : 0.2627291679382324 step3:velours_tree Fri Apr 25 07:34:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : {22421455: [{'flou': 22421487, 'Carton_gris': 22421488, 'Carton_brun': 22421489, 'papier': 22421490, 'environnement': 22421491, 'Teint_Dans_La_Masse': 22421492, 'metal': 22421493, 'plastique': 22421494, 'kraft': 22421495, 'cartonnette': 22421496, 'mal_croppe': 22421497, 'autre_refus': 22421498}]} input_args_next_step : {22421455: ()} output_args : {22421455: [{'flou': 22421487, 'Carton_gris': 22421488, 'Carton_brun': 22421489, 'papier': 22421490, 'environnement': 22421491, 'Teint_Dans_La_Masse': 22421492, 'metal': 22421493, 'plastique': 22421494, 'kraft': 22421495, 'cartonnette': 22421496, 'mal_croppe': 22421497, 'autre_refus': 22421498}]} args : 22421455 depend.output_id : 0 VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :1, first value : ({'flou': 22421487, 'Carton_gris': 22421488, 'Carton_brun': 22421489, 'papier': 22421490, 'environnement': 22421491, 'Teint_Dans_La_Masse': 22421492, 'metal': 22421493, 'plastique': 22421494, 'kraft': 22421495, 'cartonnette': 22421496, 'mal_croppe': 22421497, 'autre_refus': 22421498},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22421455) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {} map_subphoto_mainphoto : {} can't find the photo_desc_type After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22421455]) Inside saveOutput : final : False verbose : True ouput is None No outpout to save, returning out of save general time spend for datou_step_exec : 0.30609607696533203 time spend to save output : 5.054473876953125e-05 total time spend for step 3 : 0.30614662170410156 step4:send_mail_cod Fri Apr 25 07:34:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! complete output_args for input 2 : {1353640573: ('0.0',), 1353640516: ('0.0',)} input_args_next_step : {1353640573: ()} output_args : {1353640573: ('0.0',), 1353640516: ('0.0',)} args : 1353640573 depend.output_id : 0 input_args_next_step : {1353640573: ('0.0',), 1353640516: ()} output_args : {1353640573: ('0.0',), 1353640516: ('0.0',)} args : 1353640516 depend.output_id : 0 Inconsistent number of input and output, step which parrallelize and manage error in input by avoiding sending an output for this data can't be used in tree dependencies of input and output complete output_args for input 3 : {22421455: [{'flou': 22421487, 'Carton_gris': 22421488, 'Carton_brun': 22421489, 'papier': 22421490, 'environnement': 22421491, 'Teint_Dans_La_Masse': 22421492, 'metal': 22421493, 'plastique': 22421494, 'kraft': 22421495, 'cartonnette': 22421496, 'mal_croppe': 22421497, 'autre_refus': 22421498}]} input_args_next_step : {1353640573: ('0.0',), 1353640516: ('0.0',), 22421455: ()} output_args : {22421455: [{'flou': 22421487, 'Carton_gris': 22421488, 'Carton_brun': 22421489, 'papier': 22421490, 'environnement': 22421491, 'Teint_Dans_La_Masse': 22421492, 'metal': 22421493, 'plastique': 22421494, 'kraft': 22421495, 'cartonnette': 22421496, 'mal_croppe': 22421497, 'autre_refus': 22421498}]} args : 22421455 depend.output_id : 0 We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :3, first value : ('0.0',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22421455) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {} map_subphoto_mainphoto : {} dans la step send mail cod work_area: /home/admin/workarea/git/Velours/python in order to get the selector url, please entre the license of selector SELECT photo_id, url FROM MTRBack.photos ph WHERE photo_id IN (1353640573,1353640516) Found this number of photos: 2 ##### Call download_photos : nb_thread : 5 begin to download photo : 1353640516 begin to download photo : 1353640573 download finish for photo 1353640516 download finish for photo 1353640573 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette224214871745559299/ imagette224214931745559299/ imagette224214941745559299/ imagette224214951745559299/ imagette224214961745559299/ imagette224214971745559299/ imagette224214981745559299/ imagette224214881745559299/ imagette224214891745559299/ imagette224214921745559299/ length of list_filenames : 2 ; length of list_pids : 2 ; length of list_args : 2 results_Auto_P22421455_25-04-2025_07_34_59.pdf 22421487 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421487 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214871745559299 22421493 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421493 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214931745559299 22421494 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421494 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214941745559299 22421495 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421495 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214951745559299 22421496 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421496 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214961745559299 22421497 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421497 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214971745559299 22421498 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421498 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214981745559299 22421488 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421488 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214881745559299 22421489 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421489 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214891745559299 22421492 SELECT ph.photo_id,ph.url,ph.username,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421492 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette224214921745559299 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22421455 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22421499,22421500,22421501,22421502,22421503,22421504,22421505,22421506,22421507,22421508,22421509,22421510?tags=flou,Carton_gris,Carton_brun,papier,environnement,Teint_Dans_La_Masse,metal,plastique,kraft,cartonnette,mal_croppe,autre_refus your option no_mail is active, we will not send the real mail to your client args[1353640573] : ('0.0',) no score found for photo 1353640573 We are sending mail with results at report@fotonower.com args[1353640516] : ('0.0',) no score found for photo 1353640516 We are sending mail with results at report@fotonower.com refus_total : 0.0 2022-04-13 10:29:59 0 SELECT ph.photo_id,ph.url,ph.username,ph.uploaded_at,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421455 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 1000 start upload file to ovh https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf results_Auto_P22421455_25-04-2025_07_34_59.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf start insert file to database insert into MTRUser.mtr_files (mtd_id,mtr_portfolio_id,text,url,format,tags,file_size,value) values ('4302','22421455','results_Auto_P22421455_25-04-2025_07_34_59.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf','pdf','','0.05','0.0') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22421455]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1353640573, 1353640516] map_info['map_portfolio_photo'] : {22421455: [1353640573, 1353640516, 1353640478, 1353640476, 1353640474, 1353640427, 1353640424, 1353640422, 1353640420, 1353640417]} final : False mtd_id 4302 list_pids : [1353640573, 1353640516] Looping around the photos to save general results len do output : 0 before output type Used above Managing all output in save final without adding information in the mtr_datou_result ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640573', None, None, None, None, None, '2761189') ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640516', None, None, None, None, None, '2761189') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 2 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', '22421455', '1353640573', None, None, None, None, None, '2761189'), ('4302', '22421455', '1353640516', None, None, None, None, None, '2761189')] time used for this insertion : 0.02779674530029297 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.8716769218444824 time spend to save output : 0.027994632720947266 total time spend for step 4 : 0.8996715545654297 step5:split_time_score Fri Apr 25 07:35:00 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : ['22421455'] We expect there is only one output and this part is used while all output are not tuple or array Inconsistent number of input and output, step which parrallelize and manage error in input by avoiding sending an output for this data can't be used in tree dependencies of input and output complete output_args for input 1 : VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :1, first value : [('22421455',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22421455) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1353640516: {'path': 'temp/1745559299_227572_1353640516_7ce3cbad69c2ff212ebd85449a67d27d.jpg', 'extension': 'jpg'}, 1353640573: {'path': 'temp/1745559299_227572_1353640573_34d46714fba0727473e1cad7169503f3.jpg', 'extension': 'jpg'}} map_subphoto_mainphoto : {} begin split time score SELECT app_name, token FROM MTRUser.mtr_app_api_token WHERE mtr_user_id=979 AND app_name="token_split_time_score" AND expire_at > NOW() select distinct dp.name from MTRPhoto.dashboard_entry_day ded, MTRPhoto.dashboard_places dp, MTRPhoto.dashboard_results dr where ded.dashboard_place_id = dp.id and ded.last_run_id = dr.dashboard_run_id and dp.id = ded.dashboard_place_id and dr.mtr_portfolio_id = 22421455; (('arc_en_ciel_jrm',),) TODO : Insert select and so on Begin split_port_in_batch_balle thcls : [{'id': 861, 'mtr_user_id': 31, 'name': 'Rungis_class_dechets_1212', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Rungis_Aluminium,Rungis_Carton,Rungis_Papier,Rungis_Plastique_clair,Rungis_Plastique_dur,Rungis_Plastique_fonce,Rungis_Tapis_vide,Rungis_Tetrapak', 'svm_portfolios_learning': '1160730,571842,571844,571839,571933,571840,571841,572307', 'photo_hashtag_type': 999, 'photo_desc_type': 3963, 'type_classification': 'caffe', 'hashtag_id_list': '2107751280,2107750907,2107750908,2107750909,2107750910,2107750911,2107750912,2107750913'}] thcls : [{'id': 758, 'mtr_user_id': 31, 'name': 'Rungis_amount_dechets_fall_2018_v2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': '05102018_Papier_non_papier_dense,05102018_Papier_non_papier_peu_dense,05102018_Papier_non_papier_presque_vide,05102018_Papier_non_papier_tres_dense,05102018_Papier_non_papier_tres_peu_dense', 'svm_portfolios_learning': '1108385,1108386,1108388,1108384,1108387', 'photo_hashtag_type': 856, 'photo_desc_type': 3853, 'type_classification': 'caffe', 'hashtag_id_list': '2107751013,2107751014,2107751015,2107751016,2107751017'}] select SUBSTRING(ph.text,16,2) as h, count(*) from MTRUser.mtr_portfolio_photos mpp inner join MTRBack.photos ph on mpp.mtr_photo_id = ph.photo_id where mpp.mtr_portfolio_id = 22421455 group by h (('07', 10),) SELECT ph.photo_id,ph.url,ph.username,ph.uploaded_at,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22421455 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 100000 SELECT cps.photo_id, cps.score, h.hashtag, cps.hashtag_id, mpp1.mtr_portfolio_id FROM MTRPhoto.class_photo_score cps, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp1 where mpp1.mtr_photo_id=cps.photo_id AND h.hashtag_id=cps.hashtag_id AND mpp1.hide_status=0 AND mpp1.mtr_portfolio_id in (22421455) AND cps.thcl in (861) order by cps.score desc LIMIT 0, 100000 SELECT cps.photo_id, cps.score, h.hashtag, cps.hashtag_id, mpp1.mtr_portfolio_id FROM MTRPhoto.class_photo_score cps, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp1 where mpp1.mtr_photo_id=cps.photo_id AND h.hashtag_id=cps.hashtag_id AND mpp1.hide_status=0 AND mpp1.mtr_portfolio_id in (22421455) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 25042025 22421455 Nombre de photos uploadées : 10 / 23040 (0%) 25042025 22421455 Nombre de photos taguées (types de déchets): 0 / 10 (0%) 25042025 22421455 Nombre de photos taguées (volume) : 0 / 10 (0%) [{'photo_id': 1353640427, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/25/a4ea4d805f7a8aa0a6bdf35ee95209e1.jpg', 'username': None, 'uploaded_at': 1745559068, 'text': 'image_25042025_07_30_04_10143.jpg'}, {'photo_id': 1353640424, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/25/25fb3c3b14ab82b0e8adcb17c5fd693d.jpg', 'username': None, 'uploaded_at': 1745559068, 'text': 'image_25042025_07_30_14_10133.jpg'}, {'photo_id': 1353640422, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/25/f83fdce301f29944aaeeae582431370c.jpg', 'username': None, 'uploaded_at': 1745559068, 'text': 'image_25042025_07_30_23_9125.jpg'}, {'photo_id': 1353640420, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/25/20eb4c2733410d6daebc8ba71804b99b.jpg', 'username': None, 'uploaded_at': 1745559068, 'text': 'image_25042025_07_30_34_10135.jpg'}] 0 [] elapsed_time : load_data_split_time_score 1.430511474609375e-06 elapsed_time : order_list_meta_photo_and_scores 4.5299530029296875e-06 ?????????? elapsed_time : fill_and_build_computed_from_old_data 0.0005040168762207031 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 22421455, '2025-04-25' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1747621,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.023497819900512695 We will return after consolidate but for now we need the day, how to get it, for now depending on the previous heavy steps SELECT dri.dashboard_entry_day, dr.dashboard_run_id, dr.mtr_portfolio_id, dr.id, dr.hashtag, dr.completion_json FROM MTRPhoto.dashboard_results dr, MTRPhoto.dashboard_run_ids dri, MTRPhoto.dashboard_entry_day ded WHERE ded.id= 1747621 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1747621, 'dashboard_run_id': 1756015, 'mtr_portfolio_id': 22419774, 'dashboard_result_id': 10095355, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22419774_25-04-2025_07_02_58.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22419807, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22419808, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22419809, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22419810, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22419811, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22419812, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22419813, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22419814, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22419815, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22419816, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22419817, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22419818, 'pht': 3726}}"}, {'dashboat_entry_day': 1747621, 'dashboard_run_id': 1756015, 'mtr_portfolio_id': 22420227, 'dashboard_result_id': 10095356, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22420227_25-04-2025_07_19_00.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22420241, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22420242, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22420243, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22420244, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22420245, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22420246, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22420247, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22420248, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22420249, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22420250, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22420251, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22420252, 'pht': 3726}}"}, {'dashboat_entry_day': 1747621, 'dashboard_run_id': 1756015, 'mtr_portfolio_id': 22421008, 'dashboard_result_id': 10095357, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421008_25-04-2025_07_33_02.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421030, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421031, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421032, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421033, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421034, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421035, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421036, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421037, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421038, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421039, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421040, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22421041, 'pht': 3726}}"}, {'dashboat_entry_day': 1747621, 'dashboard_run_id': 1756015, 'mtr_portfolio_id': 22421455, 'dashboard_result_id': 10095358, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_33_31.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22421487, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421488, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421489, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421490, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421491, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421492, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421493, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421494, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421495, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421496, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421497, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421498, 'pht': 3726}}"}] SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22419774 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2761022, 'mtr_portfolio_id': 22419774, 'created_at': datetime.datetime(2025, 4, 25, 7, 2, 57), 'result': '0.06258476523546622', 'result_long': None, 'result_double': None}] Qualite : 0.06258476523546622 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22419774 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22419774_25-04-2025_07_02_58.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22419774 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22419774_25-04-2025_07_02_58.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22419807, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22419808, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22419809, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22419810, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22419811, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22419812, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22419813, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22419814, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22419815, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22419816, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22419817, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22419818, 'pht': 3726}}" where mtr_portfolio_id = 22419774 and dashboard_run_id = 1756015 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22419774 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10095355, 0.06258476523546622, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22419774_25-04-2025_07_02_58.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22419807, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22419808, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22419809, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22419810, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22419811, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22419812, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22419813, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22419814, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22419815, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22419816, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22419817, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22419818, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22420227 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2761079, 'mtr_portfolio_id': 22420227, 'created_at': datetime.datetime(2025, 4, 25, 7, 18, 59), 'result': '0.051449123003213956', 'result_long': None, 'result_double': None}] Qualite : 0.051449123003213956 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22420227 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22420227_25-04-2025_07_19_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22420227 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22420227_25-04-2025_07_19_00.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22420241, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22420242, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22420243, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22420244, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22420245, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22420246, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22420247, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22420248, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22420249, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22420250, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22420251, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22420252, 'pht': 3726}}" where mtr_portfolio_id = 22420227 and dashboard_run_id = 1756015 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22420227 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10095356, 0.051449123003213956, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22420227_25-04-2025_07_19_00.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22420241, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22420242, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22420243, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22420244, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22420245, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22420246, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22420247, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22420248, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22420249, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22420250, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22420251, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22420252, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22421008 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2761139, 'mtr_portfolio_id': 22421008, 'created_at': datetime.datetime(2025, 4, 25, 7, 33, 1), 'result': '0.0627017188038757', 'result_long': None, 'result_double': None}] Qualite : 0.0627017188038757 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22421008 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421008_25-04-2025_07_33_02.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22421008 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421008_25-04-2025_07_33_02.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421030, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421031, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421032, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421033, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421034, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421035, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421036, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421037, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421038, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421039, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421040, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22421041, 'pht': 3726}}" where mtr_portfolio_id = 22421008 and dashboard_run_id = 1756015 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22421008 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10095357, 0.0627017188038757, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421008_25-04-2025_07_33_02.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421030, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421031, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421032, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421033, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421034, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421035, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421036, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421037, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421038, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421039, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421040, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22421041, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22421455 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22421455 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 ORDER BY created_at desc LIMIT 1 select value from MTRUser.portfolio_carac_ratio where portfolio_id = 22421455 and created_at >= ( SELECT min(created_at) FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22421455 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 )and created_at < ( SELECT addtime(max(created_at),100) FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22421455 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 ) order by value desc list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2761189, 'mtr_portfolio_id': 22421455, 'created_at': datetime.datetime(2025, 4, 25, 7, 34, 59), 'result': 0.0, 'result_long': None, 'result_double': None}] Qualite : 0.0 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22421455 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22421455 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22421487, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421488, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421489, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421490, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421491, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421492, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421493, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421494, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421495, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421496, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421497, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421498, 'pht': 3726}}" where mtr_portfolio_id = 22421455 and dashboard_run_id = 1756015 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22421455 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10095358, 0.0, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22421455_25-04-2025_07_34_59.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22421487, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22421488, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22421489, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22421490, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22421491, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22421492, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22421493, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22421494, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22421495, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22421496, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22421497, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22421498, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22419774,22420227,22421008,22421455) result : ((1353634744,), (1353634748,), (1353634749,), (1353634751,), (1353634754,), (1353634780,), (1353634782,), (1353634784,), (1353634786,), (1353634815,), (1353634817,), (1353634819,), (1353634821,), (1353634824,), (1353634826,), (1353634844,), (1353634845,), (1353634846,), (1353634847,), (1353634849,), (1353634872,), (1353634880,), (1353634913,), (1353634916,), (1353634955,), (1353635090,), (1353635095,), (1353635160,), (1353635163,), (1353635165,), (1353635167,), (1353635171,), (1353635175,), (1353635207,), (1353635209,), (1353635213,), (1353635215,), (1353635218,), (1353635285,), (1353635316,), (1353635346,), (1353635374,), (1353635401,), (1353635972,), (1353635979,), (1353635990,), (1353636000,), (1353636006,), (1353636015,), (1353636018,), (1353636020,), (1353636021,), (1353636023,), (1353636027,), (1353636028,), (1353636033,), (1353636077,), (1353636064,), (1353636069,), (1353636071,), (1353636073,), (1353636330,), (1353636335,), (1353636339,), (1353636343,), (1353636374,), (1353636379,), (1353636384,), (1353636388,), (1353636391,), (1353636394,), (1353636880,), (1353637094,), (1353637292,), (1353637374,), (1353637875,), (1353637919,), (1353637951,), (1353637978,), (1353638009,), (1353638037,), (1353638273,), (1353638301,), (1353638309,), (1353638314,), (1353638315,), (1353638345,), (1353638353,), (1353638355,), (1353638357,), (1353638436,), (1353638464,), (1353638493,), (1353638522,), (1353638555,), (1353638583,), (1353638801,), (1353638806,), (1353638824,), (1353638848,), (1353638992,), (1353638997,), (1353639005,), (1353639016,), (1353639021,), (1353639024,), (1353639066,), (1353639070,), (1353639091,), (1353639094,), (1353639191,), (1353639196,), (1353639220,), (1353639244,), (1353639257,), (1353639260,), (1353639330,), (1353639361,), (1353639387,), (1353639390,), (1353639492,), (1353639496,), (1353639500,), (1353639502,), (1353639545,), (1353639551,), (1353639555,), (1353639558,), (1353639560,), (1353639564,), (1353639626,), (1353639607,), (1353639610,), (1353639614,), (1353639654,), (1353639658,), (1353639662,), (1353639664,), (1353639665,), (1353639673,), (1353639735,), (1353639750,), (1353639758,), (1353639762,), (1353639794,), (1353639798,), (1353639801,), (1353639803,), (1353639850,), (1353639852,), (1353639855,), (1353639856,), (1353639858,), (1353639860,), (1353639891,), (1353639893,), (1353639896,), (1353639899,), (1353639951,), (1353639978,), (1353639981,), (1353639982,), (1353639987,), (1353640028,), (1353640031,), (1353640034,), (1353640036,), (1353640038,), (1353640040,), (1353640066,), (1353640073,), (1353640076,), (1353640080,), (1353640083,), (1353640110,), (1353640112,), (1353640115,), (1353640118,), (1353640120,), (1353640123,), (1353640174,), (1353640175,), (1353640181,), (1353640183,), (1353640189,), (1353640192,), (1353640218,), (1353640220,), (1353640223,), (1353640226,), (1353640263,), (1353640312,), (1353640315,), (1353640367,), (1353640372,), (1353640375,), (1353640376,), (1353640379,), (1353640381,), (1353640431,), (1353640417,), (1353640420,), (1353640422,), (1353640424,), (1353640427,), (1353640474,), (1353640476,), (1353640478,), (1353640516,), (1353640573,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'25042025': {'nb_upload': 10, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22421455]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1353640573, 1353640516] map_info['map_portfolio_photo'] : {22421455: [1353640573, 1353640516, 1353640478, 1353640476, 1353640474, 1353640427, 1353640424, 1353640422, 1353640420, 1353640417]} final : True mtd_id 4302 list_pids : [1353640573, 1353640516] Looping around the photos to save general results len do output : 1 /22421455Didn't retrieve data . before output type Here is an output not treated by saveGeneral : Managing all output in save final without adding information in the mtr_datou_result ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640573', None, None, None, None, None, '2761189') ('4302', None, None, None, None, None, None, None, '2761189') ('4302', '22421455', '1353640516', None, None, None, None, None, '2761189') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 3 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', None, '22421455', 'None', None, None, None, None, '2761189'), ('4302', '22421455', '1353640573', None, None, None, None, None, '2761189'), ('4302', '22421455', '1353640516', None, None, None, None, None, '2761189')] time used for this insertion : 0.01296234130859375 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.3347136974334717 time spend to save output : 0.013139724731445312 total time spend for step 5 : 0.347853422164917 caffe_path_current : About to save ! 2 After save, about to update current ! ret : 2 len(input) + len(total_photo_id_missing) : 1 set_done_treatment DELETE from MTRPhoto.mtr_datou_current where id in (2761189) 1.85user 2.29system 0:05.65elapsed 73%CPU (0avgtext+0avgdata 156784maxresident)k 48inputs+1472outputs (1major+63474minor)pagefaults 0swaps