insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108274 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='Carton_brun' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108274) result : ((1350340165,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108275 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='plastique' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108275) result : ((1350340200,), (1350340201,), (1350340396,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108276 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='autre_refus' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108276) result : ((1350340392,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108277 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='flou' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108277) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108278 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='Teint_Dans_La_Masse' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108278) result : ((1350340158,), (1350340160,), (1350340385,), (1350340388,), (1350340389,), (1350340390,), (1350340391,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108279 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='kraft' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108279) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22108280 , sub_photo_id, 979,now() FROM (SELECT csp.sub_photo_id, csp.crop_hashtag_id, csp.created_at FROM MTRPhoto.crop_sub_photo_ids csp, MTRPhoto.crop_hashtag_ids chi, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp WHERE mpp.mtr_portfolio_id=22108240 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='cartonnette' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108280) result : ((1350340163,), (1350340394,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22108240) result : ((1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") To do ! Use context local managing function ! 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`=22108240 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','cartonnette','mal_croppe','environnement','autre_refus','kraft','flou','plastique','metal','Carton_brun','papier')) AND mptpi.`min_score`=0.5 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`=22108240 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','cartonnette','mal_croppe','environnement','autre_refus','kraft','flou','plastique','metal','Carton_brun','papier')) AND mptpi.`min_score`=0.5 To do returned map {'Carton_gris': {'main_port_id': 22108240, 'sub_port_id': 22108281, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590835, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'papier': {'main_port_id': 22108240, 'sub_port_id': 22108282, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590836, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'mal_croppe': {'main_port_id': 22108240, 'sub_port_id': 22108283, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590837, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'environnement': {'main_port_id': 22108240, 'sub_port_id': 22108284, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590838, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'metal': {'main_port_id': 22108240, 'sub_port_id': 22108285, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590839, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'Carton_brun': {'main_port_id': 22108240, 'sub_port_id': 22108286, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590840, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'plastique': {'main_port_id': 22108240, 'sub_port_id': 22108287, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590841, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'autre_refus': {'main_port_id': 22108240, 'sub_port_id': 22108288, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590842, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'flou': {'main_port_id': 22108240, 'sub_port_id': 22108289, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590843, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'Teint_Dans_La_Masse': {'main_port_id': 22108240, 'sub_port_id': 22108290, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590844, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'kraft': {'main_port_id': 22108240, 'sub_port_id': 22108291, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590845, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}, 'cartonnette': {'main_port_id': 22108240, 'sub_port_id': 22108292, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14590846, 'last_updated_at': datetime.datetime(2025, 4, 7, 15, 35), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 15, 35), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 15, 34, 59)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108281,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108269 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108282,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108270 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108283,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108271 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108284,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108272 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108285,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108273 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108286,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108274 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108287,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108275 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108288,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108276 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108289,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108277 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108290,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108278 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108291,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108279 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22108292,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22108280 lien utilise dans velours : https://www.fotonower.com/velours/22108281,22108282,22108283,22108284,22108285,22108286,22108287,22108288,22108289,22108290,22108291,22108292?tags=Carton_gris,papier,mal_croppe,environnement,metal,Carton_brun,plastique,autre_refus,flou,Teint_Dans_La_Masse,kraft,cartonnette After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22108240]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] map_info['map_portfolio_photo'] : {22108240: [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162, 1350339987, 1350339982, 1350339979, 1350339933, 1350339912, 1350339896, 1350339873, 1350339852, 1350339841, 1350339701, 1350339677, 1350339643, 1350339615, 1350339454, 1350339451]} final : False mtd_id 4302 list_pids : [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] Looping around the photos to save general results len do output : 1 /22108240. 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, '2729359') ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 7 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, '22108240', "{'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280}", None, None, None, None, '2729359'), ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359')] time used for this insertion : 0.013731718063354492 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.572510004043579 time spend to save output : 0.01394963264465332 total time spend for step 1 : 1.5864596366882324 step2:final Mon Apr 7 15:36: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 ! 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 :0, first value : [] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22108240) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {} map_subphoto_mainphoto : {} Beginning of datou step final ! query to retrieve results for portfolio 22108240 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1350339454,1350339451,1350339701,1350339677,1350339643,1350339615,1350339933,1350339912,1350339896,1350339873,1350339852,1350339841,1350339987,1350339982,1350339979,1350340283,1350340222,1350340215,1350340205,1350340171,1350340162); insert ignore into MTRUser.portfolio_carac_ratio (portfolio_id, hashtag_type, hashtag_id, value) values (%s,%s,%s,%s) on DUPLICATE KEY UPDATE value=VALUES(value) After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22108240]) Inside saveOutput : final : False verbose : True original output for save of step final : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} new output for save of step final : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] map_info['map_portfolio_photo'] : {22108240: [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162, 1350339987, 1350339982, 1350339979, 1350339933, 1350339912, 1350339896, 1350339873, 1350339852, 1350339841, 1350339701, 1350339677, 1350339643, 1350339615, 1350339454, 1350339451]} final : False mtd_id 4302 list_pids : [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] Looping around the photos to save general results len do output : 6 /1350340283.Didn't retrieve data . /1350340222.Didn't retrieve data . /1350340215.Didn't retrieve data . /1350340205.Didn't retrieve data . /1350340171.Didn't retrieve data . /1350340162.Didn't retrieve data . 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, '2729359') ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 18 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', '22108240', '1350340283', '0.023507529558555076', None, None, None, None, '2729359'), ('4302', '22108240', '1350340222', '0.023507529558555076', None, None, None, None, '2729359'), ('4302', '22108240', '1350340215', '0.023507529558555076', None, None, None, None, '2729359'), ('4302', '22108240', '1350340205', '0.023507529558555076', None, None, None, None, '2729359'), ('4302', '22108240', '1350340171', '0.023507529558555076', None, None, None, None, '2729359'), ('4302', '22108240', '1350340162', '0.023507529558555076', None, None, None, None, '2729359')] time used for this insertion : 0.012376785278320312 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.0633082389831543 time spend to save output : 0.012665271759033203 total time spend for step 2 : 0.0759735107421875 step3:velours_tree Mon Apr 7 15:36: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 : {22108240: [{'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280}]} input_args_next_step : {22108240: ()} output_args : {22108240: [{'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280}]} args : 22108240 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 : ({'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22108240) 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([22108240]) 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.3229835033416748 time spend to save output : 8.463859558105469e-05 total time spend for step 3 : 0.32306814193725586 step4:send_mail_cod Mon Apr 7 15:36: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 : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} input_args_next_step : {1350340283: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340283 depend.output_id : 0 input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340222 depend.output_id : 0 input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340215 depend.output_id : 0 input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340205 depend.output_id : 0 input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340171 depend.output_id : 0 input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ()} output_args : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',)} args : 1350340162 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 : {22108240: [{'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280}]} input_args_next_step : {1350340283: ('0.023507529558555076',), 1350340222: ('0.023507529558555076',), 1350340215: ('0.023507529558555076',), 1350340205: ('0.023507529558555076',), 1350340171: ('0.023507529558555076',), 1350340162: ('0.023507529558555076',), 22108240: ()} output_args : {22108240: [{'Carton_gris': 22108269, 'papier': 22108270, 'mal_croppe': 22108271, 'environnement': 22108272, 'metal': 22108273, 'Carton_brun': 22108274, 'plastique': 22108275, 'autre_refus': 22108276, 'flou': 22108277, 'Teint_Dans_La_Masse': 22108278, 'kraft': 22108279, 'cartonnette': 22108280}]} args : 22108240 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 :7, first value : ('0.023507529558555076',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22108240) 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 (1350340283,1350340222,1350340215,1350340205,1350340171,1350340162) Found this number of photos: 6 ##### Call download_photos : nb_thread : 5 begin to download photo : 1350340162 begin to download photo : 1350340205 begin to download photo : 1350340222 download finish for photo 1350340205 begin to download photo : 1350340215 download finish for photo 1350340222 begin to download photo : 1350340283 download finish for photo 1350340162 begin to download photo : 1350340171 download finish for photo 1350340215 download finish for photo 1350340283 download finish for photo 1350340171 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette221082711744033020/ imagette221082731744033020/ length of list_filenames : 6 ; length of list_pids : 6 ; length of list_args : 6 results_Auto_P22108240_07-04-2025_15_37_00.pdf 22108271 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=22108271 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221082711744033020 22108273 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=22108273 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221082731744033020 22108275 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=22108275 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350340200: '1744032853_1125827_1350339701_298a4294e8dc44035e701a42922b6200_rle_crop_3749129767_0.png', 1350340201: '1744032853_1125827_1350339451_d2dbb683e115a4f4928d07df0abb6344_rle_crop_3749129944_0.png', 1350340396: '1744032928_457538_1350339912_26a7f1f27244e7b71c43085197b3f65e_rle_crop_3749132378_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/02328217e93a6b2b8259a6e8c6bf306e_26959817.png change filename to text .wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/34f755a919d435dddd5ad15dda150065_73464770.png change filename to text .imagette221082751744033020/ imagette221082751744033020/1744032853_1125827_1350339451_d2dbb683e115a4f4928d07df0abb6344_rle_crop_3749129944_0.png.png imagette221082751744033020/1744032853_1125827_1350339701_298a4294e8dc44035e701a42922b6200_rle_crop_3749129767_0.png.png imagette221082751744033020/1744032928_457538_1350339912_26a7f1f27244e7b71c43085197b3f65e_rle_crop_3749132378_0.png.png wget -O 3.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/e9d37a0a4540b5b4031c924ed6928d37_31670966.png imagette221082751744033020 22108276 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=22108276 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350340392: '1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132427_0.png'} change filename to text .imagette221082761744033020/ imagette221082761744033020/1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132427_0.png.png imagette221082771744033020/ imagette221082791744033020/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/0e255bcfdc59effb92911575429349bd_41987904.png imagette221082761744033020 22108277 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=22108277 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221082771744033020 22108279 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=22108279 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221082791744033020 22108280 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=22108280 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350340163: '1744032853_1125827_1350339701_298a4294e8dc44035e701a42922b6200_rle_crop_3749129769_0.png', 1350340394: '1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132423_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/ab8a3b99ae33d24c739caf5ba7d751ae_9207250.png change filename to text .imagette221082801744033020/ imagette221082801744033020/1744032853_1125827_1350339701_298a4294e8dc44035e701a42922b6200_rle_crop_3749129769_0.png.png imagette221082801744033020/1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132423_0.png.png imagette221082691744033020/ wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/9d9df051773e04b815bf070fc6364e4c_34009203.png imagette221082801744033020 22108269 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=22108269 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221082691744033020 22108274 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=22108274 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350340165: '1744032853_1125827_1350339454_db96b1da5b852d735e8588945b716bec_rle_crop_3749129857_0.png'} change filename to text .imagette221082741744033020/ imagette221082741744033020/1744032853_1125827_1350339454_db96b1da5b852d735e8588945b716bec_rle_crop_3749129857_0.png.png wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/6f95a05b8f277281533d588ccc900db3_38426744.png imagette221082741744033020 22108278 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=22108278 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350340158: '1744032853_1125827_1350339454_db96b1da5b852d735e8588945b716bec_rle_crop_3749129865_0.png', 1350340160: '1744032853_1125827_1350339451_d2dbb683e115a4f4928d07df0abb6344_rle_crop_3749129950_0.png', 1350340385: '1744032928_457538_1350339987_c3748530ba85e1afac79ec2271ff71cc_rle_crop_3749132362_0.png', 1350340388: '1744032928_457538_1350339873_13eaa20e65edb809772753640a510203_rle_crop_3749132421_0.png', 1350340389: '1744032928_457538_1350339873_13eaa20e65edb809772753640a510203_rle_crop_3749132419_0.png', 1350340390: '1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132432_0.png', 1350340391: '1744032928_457538_1350339841_c3e379bd3707bcda2e592cadf32d1e53_rle_crop_3749132441_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/a612753ce98cb558c09d09ef42e6d08c_91111941.png change filename to text .wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/778b35ca95df1a58ebb88dced8d4fd54_18783397.png change filename to text .wget -O 3.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/bb8e49b1833dd7443957a58236adde00_49338535.png change filename to text .wget -O 4.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/a73276f41057a5d8c75c1b0d2c52f822_76973053.png change filename to text .wget -O 5.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/b1497558cb2bc9927b47a4c36743767c_48616514.png change filename to text .wget -O 6.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/0237122f39d400ba03a77a40d8c1f76f_73637134.png change filename to text .imagette221082781744033020/ imagette221082781744033020/1744032853_1125827_1350339451_d2dbb683e115a4f4928d07df0abb6344_rle_crop_3749129950_0.png.png imagette221082781744033020/1744032928_457538_1350339873_13eaa20e65edb809772753640a510203_rle_crop_3749132421_0.png.png imagette221082781744033020/1744032928_457538_1350339873_13eaa20e65edb809772753640a510203_rle_crop_3749132419_0.png.png imagette221082781744033020/1744032928_457538_1350339987_c3748530ba85e1afac79ec2271ff71cc_rle_crop_3749132362_0.png.png imagette221082781744033020/1744032928_457538_1350339841_c3e379bd3707bcda2e592cadf32d1e53_rle_crop_3749132441_0.png.png imagette221082781744033020/1744032853_1125827_1350339454_db96b1da5b852d735e8588945b716bec_rle_crop_3749129865_0.png.png imagette221082781744033020/1744032928_457538_1350339852_7cde1496bd805da583167638075a8e53_rle_crop_3749132432_0.png.png wget -O 7.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/f61ad1fd0efe2849f25063237d33f9a3_70661485.png imagette221082781744033020 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22108240 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22108281,22108282,22108283,22108284,22108285,22108286,22108287,22108288,22108289,22108290,22108291,22108292?tags=Carton_gris,papier,mal_croppe,environnement,metal,Carton_brun,plastique,autre_refus,flou,Teint_Dans_La_Masse,kraft,cartonnette your option no_mail is active, we will not send the real mail to your client args[1350340283] : ('0.023507529558555076',) no score found for photo 1350340283 We are sending mail with results at report@fotonower.com args[1350340222] : ('0.023507529558555076',) no score found for photo 1350340222 We are sending mail with results at report@fotonower.com args[1350340215] : ('0.023507529558555076',) no score found for photo 1350340215 We are sending mail with results at report@fotonower.com args[1350340205] : ('0.023507529558555076',) no score found for photo 1350340205 We are sending mail with results at report@fotonower.com args[1350340171] : ('0.023507529558555076',) no score found for photo 1350340171 We are sending mail with results at report@fotonower.com args[1350340162] : ('0.023507529558555076',) no score found for photo 1350340162 We are sending mail with results at report@fotonower.com refus_total : 0.023507529558555076 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=22108240 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_P22108240_07-04-2025_15_37_00.pdf results_Auto_P22108240_07-04-2025_15_37_00.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22108240_07-04-2025_15_37_00.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','22108240','results_Auto_P22108240_07-04-2025_15_37_00.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22108240_07-04-2025_15_37_00.pdf','pdf','','0.11','0.023507529558555076') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22108240]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] map_info['map_portfolio_photo'] : {22108240: [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162, 1350339987, 1350339982, 1350339979, 1350339933, 1350339912, 1350339896, 1350339873, 1350339852, 1350339841, 1350339701, 1350339677, 1350339643, 1350339615, 1350339454, 1350339451]} final : False mtd_id 4302 list_pids : [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] 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, '2729359') ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359') 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', '22108240', '1350340283', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359')] time used for this insertion : 0.012135982513427734 save_final save missing photos in datou_result : time spend for datou_step_exec : 2.178579092025757 time spend to save output : 0.012314319610595703 total time spend for step 4 : 2.1908934116363525 step5:split_time_score Mon Apr 7 15:37:02 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 : ['22108240'] 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 : [('22108240',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22108240) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1350340205: {'path': 'temp/1744033019_1014119_1350340205_1b1d67da59fa070ed2a4dd7d5ffeb530.jpg', 'extension': 'jpg'}, 1350340215: {'path': 'temp/1744033019_1014119_1350340215_32dd2cee6fa64624c60a68ad84bffbd2.jpg', 'extension': 'jpg'}, 1350340222: {'path': 'temp/1744033019_1014119_1350340222_a3704c0427bd4f3b317f49beb943c81a.jpg', 'extension': 'jpg'}, 1350340283: {'path': 'temp/1744033019_1014119_1350340283_630d7b9e329ea77ca9d79fc0e252aa6a.jpg', 'extension': 'jpg'}, 1350340162: {'path': 'temp/1744033019_1014119_1350340162_dd3f8d3c318119d85116776ec11f3378.jpg', 'extension': 'jpg'}, 1350340171: {'path': 'temp/1744033019_1014119_1350340171_20fb43382cc376f06bef03d7d97596b3.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 = 22108240; (('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 = 22108240 group by h (('15', 21),) 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=22108240 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 (22108240) 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 (22108240) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 07042025 22108240 Nombre de photos uploadées : 21 / 23040 (0%) 07042025 22108240 Nombre de photos taguées (types de déchets): 0 / 21 (0%) 07042025 22108240 Nombre de photos taguées (volume) : 0 / 21 (0%) [{'photo_id': 1350339454, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/db96b1da5b852d735e8588945b716bec.jpg', 'username': None, 'uploaded_at': 1744032667, 'text': 'image_07042025_15_30_33_10133.jpg 1e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1350339451, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/d2dbb683e115a4f4928d07df0abb6344.jpg', 'username': None, 'uploaded_at': 1744032667, 'text': 'image_07042025_15_30_43_10133.jpg 2e-05 for time 1, id_amount 3 this amount prod time diff : 1e-05'}, {'photo_id': 1350339701, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/298a4294e8dc44035e701a42922b6200.jpg', 'username': None, 'uploaded_at': 1744032727, 'text': 'image_07042025_15_30_54_10136.jpg 3.0000000000000004e-05 for time 1, id_amount 3 this amount prod time diff : 1e-05'}, {'photo_id': 1350339677, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/ce523cd915f540bf6329d8b9dddf9f01.jpg', 'username': None, 'uploaded_at': 1744032727, 'text': 'image_07042025_15_31_13_9124.jpg'}] 0 [] elapsed_time : load_data_split_time_score 2.6226043701171875e-06 elapsed_time : order_list_meta_photo_and_scores 6.4373016357421875e-06 ????????????????????? elapsed_time : fill_and_build_computed_from_old_data 0.0008504390716552734 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 22108240, '2025-04-07' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1719143,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.022799968719482422 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= 1719143 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1719143, 'dashboard_run_id': 1728294, 'mtr_portfolio_id': 22106129, 'dashboard_result_id': 9909050, '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_P22106129_07-04-2025_15_03_00.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106132, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106133, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106134, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106135, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106136, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106137, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106138, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106139, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106140, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106141, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106142, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106143, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1728294, 'mtr_portfolio_id': 22106775, 'dashboard_result_id': 9909051, '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_P22106775_07-04-2025_15_18_59.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106779, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106780, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106781, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106782, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106783, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106784, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106785, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106786, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106787, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106788, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106789, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106790, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1728294, 'mtr_portfolio_id': 22107458, 'dashboard_result_id': 9909052, '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_P22107458_07-04-2025_15_32_59.pdf', 'metal': {'hashtag': 'metal', 'sub_port_id': 22107517, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22107518, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22107519, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22107520, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22107521, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22107522, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22107523, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22107524, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22107525, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22107526, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22107527, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22107528, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1728294, 'mtr_portfolio_id': 22108240, 'dashboard_result_id': 9909053, '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_P22108240_07-04-2025_15_35_03.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22108269, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22108270, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22108271, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22108272, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22108273, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22108274, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22108275, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22108276, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22108277, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22108278, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22108279, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22108280, '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 = 22106129 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': 2729183, 'mtr_portfolio_id': 22106129, 'created_at': datetime.datetime(2025, 4, 7, 15, 2, 59), 'result': '0.046573715608836566', 'result_long': None, 'result_double': None}] Qualite : 0.046573715608836566 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22106129 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22106129_07-04-2025_15_03_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22106129 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_P22106129_07-04-2025_15_03_00.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106132, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106133, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106134, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106135, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106136, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106137, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106138, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106139, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106140, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106141, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106142, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106143, 'pht': 3726}}" where mtr_portfolio_id = 22106129 and dashboard_run_id = 1728294 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`=22106129 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9909050, 0.046573715608836566, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22106129_07-04-2025_15_03_00.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106132, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106133, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106134, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106135, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106136, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106137, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106138, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106139, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106140, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106141, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106142, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106143, '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 = 22106775 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': 2729249, 'mtr_portfolio_id': 22106775, 'created_at': datetime.datetime(2025, 4, 7, 15, 18, 58), 'result': '0.058886222886007346', 'result_long': None, 'result_double': None}] Qualite : 0.058886222886007346 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22106775 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22106775_07-04-2025_15_18_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22106775 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_P22106775_07-04-2025_15_18_59.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106779, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106780, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106781, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106782, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106783, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106784, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106785, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106786, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106787, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106788, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106789, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106790, 'pht': 3726}}" where mtr_portfolio_id = 22106775 and dashboard_run_id = 1728294 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`=22106775 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9909051, 0.058886222886007346, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22106775_07-04-2025_15_18_59.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22106779, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22106780, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22106781, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22106782, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22106783, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22106784, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22106785, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22106786, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22106787, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22106788, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22106789, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22106790, '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 = 22107458 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': 2729296, 'mtr_portfolio_id': 22107458, 'created_at': datetime.datetime(2025, 4, 7, 15, 32, 59), 'result': '0.05895099783638643', 'result_long': None, 'result_double': None}] Qualite : 0.05895099783638643 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22107458 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22107458_07-04-2025_15_32_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22107458 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_P22107458_07-04-2025_15_32_59.pdf', 'metal': {'hashtag': 'metal', 'sub_port_id': 22107517, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22107518, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22107519, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22107520, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22107521, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22107522, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22107523, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22107524, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22107525, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22107526, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22107527, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22107528, 'pht': 3726}}" where mtr_portfolio_id = 22107458 and dashboard_run_id = 1728294 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`=22107458 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9909052, 0.05895099783638643, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22107458_07-04-2025_15_32_59.pdf', 'metal': {'hashtag': 'metal', 'sub_port_id': 22107517, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22107518, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22107519, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22107520, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22107521, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22107522, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22107523, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22107524, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22107525, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22107526, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22107527, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22107528, '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 = 22108240 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': 2729359, 'mtr_portfolio_id': 22108240, 'created_at': datetime.datetime(2025, 4, 7, 15, 36, 59), 'result': '0.023507529558555076', 'result_long': None, 'result_double': None}] Qualite : 0.023507529558555076 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22108240 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22108240_07-04-2025_15_37_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22108240 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_P22108240_07-04-2025_15_37_00.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22108269, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22108270, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22108271, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22108272, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22108273, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22108274, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22108275, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22108276, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22108277, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22108278, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22108279, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22108280, 'pht': 3726}}" where mtr_portfolio_id = 22108240 and dashboard_run_id = 1728294 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`=22108240 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9909053, 0.023507529558555076, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22108240_07-04-2025_15_37_00.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22108269, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22108270, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22108271, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22108272, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22108273, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22108274, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22108275, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22108276, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22108277, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22108278, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22108279, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22108280, '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 (22106129,22106775,22107458,22108240) result : ((1350327299,), (1350327307,), (1350327316,), (1350327324,), (1350327338,), (1350327501,), (1350327536,), (1350327540,), (1350327544,), (1350327549,), (1350327583,), (1350327587,), (1350327590,), (1350327594,), (1350327682,), (1350327690,), (1350327693,), (1350327739,), (1350327855,), (1350327863,), (1350327869,), (1350327875,), (1350327879,), (1350327883,), (1350327962,), (1350327964,), (1350327968,), (1350327972,), (1350327977,), (1350328039,), (1350328044,), (1350328053,), (1350328126,), (1350328178,), (1350328235,), (1350328256,), (1350328295,), (1350328318,), (1350328399,), (1350328447,), (1350328478,), (1350328501,), (1350328516,), (1350328535,), (1350328706,), (1350328795,), (1350328803,), (1350328809,), (1350328897,), (1350328925,), (1350328955,), (1350328971,), (1350328997,), (1350329065,), (1350329071,), (1350329076,), (1350329078,), (1350329192,), (1350329196,), (1350329199,), (1350329203,), (1350329208,), (1350329297,), (1350330227,), (1350330292,), (1350330323,), (1350330371,), (1350330408,), (1350330461,), (1350330575,), (1350330649,), (1350330700,), (1350330800,), (1350331092,), (1350330963,), (1350331038,), (1350331679,), (1350331766,), (1350331923,), (1350331986,), (1350332051,), (1350332110,), (1350332542,), (1350332610,), (1350332673,), (1350332756,), (1350332832,), (1350332897,), (1350333250,), (1350333307,), (1350333344,), (1350333385,), (1350333997,), (1350334040,), (1350334103,), (1350334162,), (1350334194,), (1350334441,), (1350334462,), (1350334470,), (1350334511,), (1350334533,), (1350334639,), (1350334644,), (1350334648,), (1350334653,), (1350334658,), (1350334703,), (1350334731,), (1350334750,), (1350334777,), (1350334800,), (1350334901,), (1350334904,), (1350334907,), (1350334910,), (1350334914,), (1350335120,), (1350335128,), (1350335133,), (1350335137,), (1350335201,), (1350335205,), (1350335207,), (1350335211,), (1350335217,), (1350335269,), (1350335279,), (1350335287,), (1350335291,), (1350335361,), (1350335364,), (1350335369,), (1350335631,), (1350335663,), (1350335691,), (1350335728,), (1350335742,), (1350335962,), (1350335980,), (1350335998,), (1350336026,), (1350336420,), (1350336310,), (1350336328,), (1350336351,), (1350336393,), (1350336540,), (1350336567,), (1350336601,), (1350336622,), (1350336659,), (1350337060,), (1350337069,), (1350337075,), (1350337237,), (1350337240,), (1350337247,), (1350337251,), (1350337256,), (1350337297,), (1350337477,), (1350337509,), (1350337517,), (1350337521,), (1350337575,), (1350337581,), (1350337591,), (1350337855,), (1350337898,), (1350337901,), (1350337913,), (1350338034,), (1350338040,), (1350338114,), (1350338130,), (1350338173,), (1350338222,), (1350338262,), (1350338396,), (1350338486,), (1350338497,), (1350338520,), (1350338571,), (1350338577,), (1350338583,), (1350338588,), (1350338593,), (1350338614,), (1350338617,), (1350338621,), (1350338625,), (1350338633,), (1350338640,), (1350338715,), (1350338721,), (1350338725,), (1350338746,), (1350338813,), (1350338822,), (1350338949,), (1350338965,), (1350338969,), (1350338972,), (1350339233,), (1350339256,), (1350339262,), (1350339268,), (1350339273,), (1350339360,), (1350339476,), (1350339451,), (1350339454,), (1350339615,), (1350339643,), (1350339677,), (1350339701,), (1350339841,), (1350339852,), (1350339873,), (1350339896,), (1350339912,), (1350339933,), (1350339979,), (1350339982,), (1350339987,), (1350340162,), (1350340171,), (1350340205,), (1350340215,), (1350340222,), (1350340283,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'07042025': {'nb_upload': 21, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22108240]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] map_info['map_portfolio_photo'] : {22108240: [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162, 1350339987, 1350339982, 1350339979, 1350339933, 1350339912, 1350339896, 1350339873, 1350339852, 1350339841, 1350339701, 1350339677, 1350339643, 1350339615, 1350339454, 1350339451]} final : True mtd_id 4302 list_pids : [1350340283, 1350340222, 1350340215, 1350340205, 1350340171, 1350340162] Looping around the photos to save general results len do output : 1 /22108240Didn'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, '2729359') ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359') ('4302', None, None, None, None, None, None, None, '2729359') ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 7 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, '22108240', 'None', None, None, None, None, '2729359'), ('4302', '22108240', '1350340283', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340222', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340215', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340205', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340171', None, None, None, None, None, '2729359'), ('4302', '22108240', '1350340162', None, None, None, None, None, '2729359')] time used for this insertion : 0.015314340591430664 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.8469312191009521 time spend to save output : 0.015508651733398438 total time spend for step 5 : 0.8624398708343506 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 (2729359) 2.22user 2.09system 0:07.28elapsed 59%CPU (0avgtext+0avgdata 159204maxresident)k 168inputs+5472outputs (5major+63916minor)pagefaults 0swaps