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 22104995 , 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=22104991 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='environnement' 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 (22104995) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22104996 , 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=22104991 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 (22104996) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22104997 , 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=22104991 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 (22104997) result : ((1350500909,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22104998 , 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=22104991 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 (22104998) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22104999 , 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=22104991 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='papier' 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 (22104999) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22105000 , 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=22104991 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 (22105000) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22105001 , 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=22104991 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 (22105001) result : ((1350500955,), (1350500958,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22105002 , 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=22104991 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_gris' 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 (22105002) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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 22105003 , 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=22104991 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 (22105003) result : ((1350500930,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22104991) result : ((1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) 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`=22104991 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','metal','environnement','flou','Teint_Dans_La_Masse','kraft','papier','autre_refus','Carton_brun','Carton_gris','cartonnette')) 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`=22104991 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','metal','environnement','flou','Teint_Dans_La_Masse','kraft','papier','autre_refus','Carton_brun','Carton_gris','cartonnette')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_plastique_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_mal_croppe_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_metal_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_environnement_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_flou_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_Teint_Dans_La_Masse_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_kraft_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_papier_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_autre_refus_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_Carton_brun_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_Carton_gris_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__16042025_22_01_54_010139_4417_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio INSERT IGNORE INTO MTRPhoto.mtr_port_to_port_ids (`mtr_portfolio_id_1`, `mtr_portfolio_id_2`, `type`, `min_score`, `hashtag_id`, `mtr_user_id`) VALUES (%s,%s,%s,%s,%s,%s)[[22104991, 22105004, 4417, 0.5, 492725882, 979], [22104991, 22105005, 4417, 0.5, 2107755527, 979], [22104991, 22105006, 4417, 0.5, 492628673, 979], [22104991, 22105007, 4417, 0.5, 493012381, 979], [22104991, 22105008, 4417, 0.5, 492777938, 979], [22104991, 22105009, 4417, 0.5, 2107752385, 979], [22104991, 22105010, 4417, 0.5, 493202403, 979], [22104991, 22105011, 4417, 0.5, 492668766, 979], [22104991, 22105012, 4417, 0.5, 2107752406, 979], [22104991, 22105013, 4417, 0.5, 2107753024, 979], [22104991, 22105014, 4417, 0.5, 2107753020, 979], [22104991, 22105015, 4417, 0.5, 702398920, 979]] 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`=22104991 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','metal','environnement','flou','Teint_Dans_La_Masse','kraft','papier','autre_refus','Carton_brun','Carton_gris','cartonnette')) 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`=22104991 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','metal','environnement','flou','Teint_Dans_La_Masse','kraft','papier','autre_refus','Carton_brun','Carton_gris','cartonnette')) AND mptpi.`min_score`=0.5 To do returned map {'plastique': {'main_port_id': 22104991, 'sub_port_id': 22105004, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589336, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'mal_croppe': {'main_port_id': 22104991, 'sub_port_id': 22105005, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589337, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'metal': {'main_port_id': 22104991, 'sub_port_id': 22105006, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589338, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'environnement': {'main_port_id': 22104991, 'sub_port_id': 22105007, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589339, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'flou': {'main_port_id': 22104991, 'sub_port_id': 22105008, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589340, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'Teint_Dans_La_Masse': {'main_port_id': 22104991, 'sub_port_id': 22105009, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589341, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'kraft': {'main_port_id': 22104991, 'sub_port_id': 22105010, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589342, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'papier': {'main_port_id': 22104991, 'sub_port_id': 22105011, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589343, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'autre_refus': {'main_port_id': 22104991, 'sub_port_id': 22105012, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589344, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'Carton_brun': {'main_port_id': 22104991, 'sub_port_id': 22105013, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589345, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'Carton_gris': {'main_port_id': 22104991, 'sub_port_id': 22105014, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589346, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}, 'cartonnette': {'main_port_id': 22104991, 'sub_port_id': 22105015, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14589347, 'last_updated_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 16, 22, 13, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 16, 22, 13, 59)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105004,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104992 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105005,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104993 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105006,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104994 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105007,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104995 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105008,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104996 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105009,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104997 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105010,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104998 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105011,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22104999 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105012,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22105000 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105013,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22105001 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105014,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22105002 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22105015,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22105003 lien utilise dans velours : https://www.fotonower.com/velours/22105004,22105005,22105006,22105007,22105008,22105009,22105010,22105011,22105012,22105013,22105014,22105015?tags=plastique,mal_croppe,metal,environnement,flou,Teint_Dans_La_Masse,kraft,papier,autre_refus,Carton_brun,Carton_gris,cartonnette After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22104991]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] map_info['map_portfolio_photo'] : {22104991: [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399]} final : False mtd_id 4302 list_pids : [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] Looping around the photos to save general results len do output : 1 /22104991. 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, '2728034') ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 9 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, '22104991', "{'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003}", None, None, None, None, '2728034'), ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034')] time used for this insertion : 0.016940593719482422 save_final save missing photos in datou_result : time spend for datou_step_exec : 2.105689287185669 time spend to save output : 0.01732039451599121 total time spend for step 1 : 2.12300968170166 step2:final Wed Apr 16 22:13: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 (22104991) 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 22104991 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1350495399,1350497038,1350496938,1350496848,1350496652,1350505026,1350501830,1350504960); 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([22104991]) Inside saveOutput : final : False verbose : True original output for save of step final : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} new output for save of step final : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] map_info['map_portfolio_photo'] : {22104991: [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399]} final : False mtd_id 4302 list_pids : [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] Looping around the photos to save general results len do output : 8 /1350505026.Didn't retrieve data . /1350504960.Didn't retrieve data . /1350501830.Didn't retrieve data . /1350497038.Didn't retrieve data . /1350496938.Didn't retrieve data . /1350496848.Didn't retrieve data . /1350496652.Didn't retrieve data . /1350495399.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, '2728034') ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 24 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', '22104991', '1350505026', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350504960', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350501830', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350497038', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350496938', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350496848', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350496652', '0.020623372122937803', None, None, None, None, '2728034'), ('4302', '22104991', '1350495399', '0.020623372122937803', None, None, None, None, '2728034')] time used for this insertion : 0.015648841857910156 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.03364706039428711 time spend to save output : 0.016257524490356445 total time spend for step 2 : 0.049904584884643555 step3:velours_tree Wed Apr 16 22:13: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 : {22104991: [{'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003}]} input_args_next_step : {22104991: ()} output_args : {22104991: [{'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003}]} args : 22104991 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 : ({'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22104991) 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([22104991]) 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.44530296325683594 time spend to save output : 7.176399230957031e-05 total time spend for step 3 : 0.4453747272491455 step4:send_mail_cod Wed Apr 16 22:13: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 : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} input_args_next_step : {1350505026: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350505026 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350504960 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350501830 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350497038 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350496938 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350496848 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350496652 depend.output_id : 0 input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ()} output_args : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',)} args : 1350495399 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 : {22104991: [{'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003}]} input_args_next_step : {1350505026: ('0.020623372122937803',), 1350504960: ('0.020623372122937803',), 1350501830: ('0.020623372122937803',), 1350497038: ('0.020623372122937803',), 1350496938: ('0.020623372122937803',), 1350496848: ('0.020623372122937803',), 1350496652: ('0.020623372122937803',), 1350495399: ('0.020623372122937803',), 22104991: ()} output_args : {22104991: [{'plastique': 22104992, 'mal_croppe': 22104993, 'metal': 22104994, 'environnement': 22104995, 'flou': 22104996, 'Teint_Dans_La_Masse': 22104997, 'kraft': 22104998, 'papier': 22104999, 'autre_refus': 22105000, 'Carton_brun': 22105001, 'Carton_gris': 22105002, 'cartonnette': 22105003}]} args : 22104991 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 :9, first value : ('0.020623372122937803',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22104991) 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 (1350505026,1350504960,1350501830,1350497038,1350496938,1350496848,1350496652,1350495399) Found this number of photos: 8 ##### Call download_photos : nb_thread : 5 begin to download photo : 1350495399 begin to download photo : 1350496848 begin to download photo : 1350497038 begin to download photo : 1350504960 download finish for photo 1350497038 begin to download photo : 1350501830 download finish for photo 1350496848 begin to download photo : 1350496938 download finish for photo 1350495399 begin to download photo : 1350496652 download finish for photo 1350504960 begin to download photo : 1350505026 download finish for photo 1350501830 download finish for photo 1350496652 download finish for photo 1350496938 download finish for photo 1350505026 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette221049921744834439/ imagette221049931744834439/ imagette221049941744834439/ imagette221049961744834439/ imagette221049981744834440/ imagette221050001744834440/ length of list_filenames : 8 ; length of list_pids : 8 ; length of list_args : 8 results_Auto_P22104991_16-04-2025_22_13_59.pdf 22104992 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=22104992 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221049921744834439 22104993 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=22104993 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221049931744834439 22104994 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=22104994 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221049941744834439 22104996 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=22104996 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221049961744834439 22104998 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=22104998 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221049981744834440 22105000 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=22105000 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221050001744834440 22105003 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=22105003 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350500930: '1744834068_3659929_1350496652_d439bb07e4f54a89d0b7302612947783_rle_crop_3750383078_0.png'} change filename to text .imagette221050031744834440/ imagette221050031744834440/1744834068_3659929_1350496652_d439bb07e4f54a89d0b7302612947783_rle_crop_3750383078_0.png.png wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/7f5d994b69dab03922a6203a0d5dfdef_17267560.png imagette221050031744834440 22104997 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=22104997 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350500909: '1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383070_0.png'} change filename to text .imagette221049971744834440/ imagette221049971744834440/1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383070_0.png.png wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/f10e0eb60643aca4ea1ca7af6e458777_86657308.png imagette221049971744834440 22105001 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=22105001 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1350500955: '1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383075_0.png', 1350500958: '1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383074_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/80df70d59e7e311fb24b673ebc72d2a6_71321018.png change filename to text .imagette221050011744834440/ imagette221050011744834440/1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383074_0.png.png imagette221050011744834440/1744834068_3659929_1350496848_704ca63913d9d59b86b00b043fc2671d_rle_crop_3750383075_0.png.png imagette221050021744834440/ wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/a8544bca0a5606b464dbd3a7bc1b232b_82226342.png imagette221050011744834440 22105002 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=22105002 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette221050021744834440 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22104991 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22105004,22105005,22105006,22105007,22105008,22105009,22105010,22105011,22105012,22105013,22105014,22105015?tags=plastique,mal_croppe,metal,environnement,flou,Teint_Dans_La_Masse,kraft,papier,autre_refus,Carton_brun,Carton_gris,cartonnette your option no_mail is active, we will not send the real mail to your client args[1350505026] : ('0.020623372122937803',) no score found for photo 1350505026 We are sending mail with results at report@fotonower.com args[1350504960] : ('0.020623372122937803',) no score found for photo 1350504960 We are sending mail with results at report@fotonower.com args[1350501830] : ('0.020623372122937803',) no score found for photo 1350501830 We are sending mail with results at report@fotonower.com args[1350497038] : ('0.020623372122937803',) no score found for photo 1350497038 We are sending mail with results at report@fotonower.com args[1350496938] : ('0.020623372122937803',) no score found for photo 1350496938 We are sending mail with results at report@fotonower.com args[1350496848] : ('0.020623372122937803',) no score found for photo 1350496848 We are sending mail with results at report@fotonower.com args[1350496652] : ('0.020623372122937803',) no score found for photo 1350496652 We are sending mail with results at report@fotonower.com args[1350495399] : ('0.020623372122937803',) no score found for photo 1350495399 We are sending mail with results at report@fotonower.com refus_total : 0.020623372122937803 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=22104991 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_P22104991_16-04-2025_22_13_59.pdf results_Auto_P22104991_16-04-2025_22_13_59.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104991_16-04-2025_22_13_59.pdf start insert file to database insert into MTRUser.mtr_files (mtd_id,mtr_portfolio_id,text,url,format,tags,file_size,value) values ('4302','22104991','results_Auto_P22104991_16-04-2025_22_13_59.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104991_16-04-2025_22_13_59.pdf','pdf','','0.09','0.020623372122937803') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22104991]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] map_info['map_portfolio_photo'] : {22104991: [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399]} final : False mtd_id 4302 list_pids : [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] 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, '2728034') ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 8 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', '22104991', '1350505026', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034')] time used for this insertion : 0.016363859176635742 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.5877468585968018 time spend to save output : 0.01667308807373047 total time spend for step 4 : 1.6044199466705322 step5:split_time_score Wed Apr 16 22:14:01 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 : ['22104991'] 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 : [('22104991',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22104991) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1350497038: {'path': 'temp/1744834439_3975032_1350497038_be380d5fb333546df9d7be57a4e22dc0.jpg', 'extension': 'jpg'}, 1350501830: {'path': 'temp/1744834439_3975032_1350501830_da7b2d4c241faf5ffad44c1c4e49a9f9.jpg', 'extension': 'jpg'}, 1350495399: {'path': 'temp/1744834439_3975032_1350495399_7d3f8c719b9d96d09ec5fe07b2401175.jpg', 'extension': 'jpg'}, 1350496652: {'path': 'temp/1744834439_3975032_1350496652_d439bb07e4f54a89d0b7302612947783.jpg', 'extension': 'jpg'}, 1350496848: {'path': 'temp/1744834439_3975032_1350496848_704ca63913d9d59b86b00b043fc2671d.jpg', 'extension': 'jpg'}, 1350496938: {'path': 'temp/1744834439_3975032_1350496938_3a6e5ee6ef4222f5c1f75634f84ad1e4.jpg', 'extension': 'jpg'}, 1350504960: {'path': 'temp/1744834439_3975032_1350504960_a48e6883ccfabd69adc81b4507878052.jpg', 'extension': 'jpg'}, 1350505026: {'path': 'temp/1744834439_3975032_1350505026_4af24d7dfa7bfa8df0cf9c747fc447b0.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 = 22104991; (('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 = 22104991 group by h (('22', 8),) 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=22104991 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 (22104991) 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 (22104991) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 16042025 22104991 Nombre de photos uploadées : 8 / 23040 (0%) 16042025 22104991 Nombre de photos taguées (types de déchets): 0 / 8 (0%) 16042025 22104991 Nombre de photos taguées (volume) : 0 / 8 (0%) [{'photo_id': 1350495399, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/7d3f8c719b9d96d09ec5fe07b2401175.jpg', 'username': None, 'uploaded_at': 1744833787, 'text': 'image_16042025_22_01_54_10139.jpg'}, {'photo_id': 1350497038, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/be380d5fb333546df9d7be57a4e22dc0.jpg', 'username': None, 'uploaded_at': 1744833847, 'text': 'image_16042025_22_02_04_10150.jpg'}, {'photo_id': 1350496938, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/3a6e5ee6ef4222f5c1f75634f84ad1e4.jpg', 'username': None, 'uploaded_at': 1744833847, 'text': 'image_16042025_22_03_04_010151m0.jpg 1e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1350496848, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/16/704ca63913d9d59b86b00b043fc2671d.jpg', 'username': None, 'uploaded_at': 1744833847, 'text': 'image_16042025_22_03_24_010137m0.jpg 2e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}] 0 [] elapsed_time : load_data_split_time_score 2.86102294921875e-06 elapsed_time : order_list_meta_photo_and_scores 1.5974044799804688e-05 ???????? elapsed_time : fill_and_build_computed_from_old_data 0.0005242824554443359 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 22104991, '2025-04-16' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1717339,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.03119063377380371 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= 1717339 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1717339, 'dashboard_run_id': 1728338, 'mtr_portfolio_id': 22102653, 'dashboard_result_id': 9906866, '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_P22102653_16-04-2025_21_32_59.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22102654, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22102655, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22102656, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22102657, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22102658, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22102659, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22102660, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22102661, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22102662, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22102663, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22102664, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22102665, 'pht': 3726}}"}, {'dashboat_entry_day': 1717339, 'dashboard_run_id': 1728338, 'mtr_portfolio_id': 22103582, 'dashboard_result_id': 9906867, '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_P22103582_16-04-2025_21_58_59.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22103585, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22103586, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22103587, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22103588, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22103589, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22103590, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22103591, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22103592, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22103593, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22103594, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22103595, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22103596, 'pht': 3726}}"}, {'dashboat_entry_day': 1717339, 'dashboard_run_id': 1728338, 'mtr_portfolio_id': 22104103, 'dashboard_result_id': 9906868, '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_P22104103_16-04-2025_22_03_00.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22104109, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22104110, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22104111, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22104112, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22104113, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22104114, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22104115, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22104116, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22104117, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22104118, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22104119, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22104120, 'pht': 3726}}"}, {'dashboat_entry_day': 1717339, 'dashboard_run_id': 1728338, 'mtr_portfolio_id': 22104991, 'dashboard_result_id': 9906869, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0}"}] 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 = 22102653 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': 2727815, 'mtr_portfolio_id': 22102653, 'created_at': datetime.datetime(2025, 4, 16, 21, 32, 59), 'result': '0.06785631317968142', 'result_long': None, 'result_double': None}] Qualite : 0.06785631317968142 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22102653 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22102653_16-04-2025_21_32_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22102653 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_P22102653_16-04-2025_21_32_59.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22102654, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22102655, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22102656, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22102657, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22102658, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22102659, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22102660, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22102661, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22102662, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22102663, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22102664, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22102665, 'pht': 3726}}" where mtr_portfolio_id = 22102653 and dashboard_run_id = 1728338 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`=22102653 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9906866, 0.06785631317968142, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22102653_16-04-2025_21_32_59.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22102654, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22102655, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22102656, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22102657, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22102658, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22102659, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22102660, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22102661, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22102662, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22102663, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22102664, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22102665, '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 = 22103582 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': 2727880, 'mtr_portfolio_id': 22103582, 'created_at': datetime.datetime(2025, 4, 16, 21, 58, 58), 'result': '0.05958496585882836', 'result_long': None, 'result_double': None}] Qualite : 0.05958496585882836 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22103582 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22103582_16-04-2025_21_58_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22103582 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_P22103582_16-04-2025_21_58_59.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22103585, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22103586, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22103587, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22103588, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22103589, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22103590, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22103591, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22103592, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22103593, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22103594, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22103595, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22103596, 'pht': 3726}}" where mtr_portfolio_id = 22103582 and dashboard_run_id = 1728338 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`=22103582 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9906867, 0.05958496585882836, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22103582_16-04-2025_21_58_59.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22103585, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22103586, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22103587, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22103588, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22103589, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22103590, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22103591, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22103592, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22103593, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22103594, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22103595, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22103596, '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 = 22104103 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': 2727976, 'mtr_portfolio_id': 22104103, 'created_at': datetime.datetime(2025, 4, 16, 22, 2, 59), 'result': '0.04317885565795219', 'result_long': None, 'result_double': None}] Qualite : 0.04317885565795219 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22104103 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104103_16-04-2025_22_03_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22104103 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_P22104103_16-04-2025_22_03_00.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22104109, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22104110, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22104111, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22104112, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22104113, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22104114, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22104115, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22104116, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22104117, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22104118, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22104119, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22104120, 'pht': 3726}}" where mtr_portfolio_id = 22104103 and dashboard_run_id = 1728338 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`=22104103 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9906868, 0.04317885565795219, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104103_16-04-2025_22_03_00.pdf', 'flou': {'hashtag': 'flou', 'sub_port_id': 22104109, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22104110, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22104111, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22104112, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22104113, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22104114, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22104115, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22104116, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22104117, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22104118, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22104119, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22104120, '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 = 22104991 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': 2728034, 'mtr_portfolio_id': 22104991, 'created_at': datetime.datetime(2025, 4, 16, 22, 13, 59), 'result': '0.020623372122937803', 'result_long': None, 'result_double': None}] Qualite : 0.020623372122937803 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22104991 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104991_16-04-2025_22_13_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22104991 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_P22104991_16-04-2025_22_13_59.pdf'}" where mtr_portfolio_id = 22104991 and dashboard_run_id = 1728338 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`=22104991 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9906869, 0.020623372122937803, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22104991_16-04-2025_22_13_59.pdf', 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22104992, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22104993, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22104994, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22104995, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22104996, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22104997, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22104998, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22104999, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22105000, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22105001, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22105002, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22105003, '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 (22102653,22103582,22104103,22104991) result : ((1350475160,), (1350475165,), (1350475183,), (1350475235,), (1350475553,), (1350475557,), (1350475561,), (1350475669,), (1350476397,), (1350476420,), (1350476432,), (1350476465,), (1350476545,), (1350476688,), (1350476691,), (1350476694,), (1350476706,), (1350477045,), (1350477074,), (1350477107,), (1350477135,), (1350477165,), (1350477471,), (1350477503,), (1350477523,), (1350477540,), (1350477576,), (1350477768,), (1350477771,), (1350477795,), (1350477818,), (1350477828,), (1350477918,), (1350477921,), (1350477924,), (1350477926,), (1350478086,), (1350478115,), (1350478163,), (1350478185,), (1350478189,), (1350478332,), (1350478348,), (1350478377,), (1350478423,), (1350478429,), (1350478502,), (1350478648,), (1350478662,), (1350478675,), (1350478735,), (1350478743,), (1350478773,), (1350478800,), (1350478836,), (1350479053,), (1350479093,), (1350479127,), (1350479177,), (1350479194,), (1350479199,), (1350479297,), (1350479304,), (1350479308,), (1350479311,), (1350479318,), (1350479796,), (1350479841,), (1350479881,), (1350480366,), (1350480237,), (1350480266,), (1350480299,), (1350480337,), (1350480428,), (1350480449,), (1350480482,), (1350480512,), (1350480544,), (1350480574,), (1350480723,), (1350480729,), (1350480735,), (1350480885,), (1350480891,), (1350480899,), (1350480911,), (1350480959,), (1350481557,), (1350481615,), (1350481672,), (1350487437,), (1350491659,), (1350490969,), (1350491646,), (1350491651,), (1350491656,), (1350491736,), (1350491783,), (1350491836,), (1350491879,), (1350495010,), (1350495399,), (1350496652,), (1350496848,), (1350496938,), (1350497038,), (1350501830,), (1350504960,), (1350505026,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'16042025': {'nb_upload': 8, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22104991]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] map_info['map_portfolio_photo'] : {22104991: [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399]} final : True mtd_id 4302 list_pids : [1350505026, 1350504960, 1350501830, 1350497038, 1350496938, 1350496848, 1350496652, 1350495399] Looping around the photos to save general results len do output : 1 /22104991Didn'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, '2728034') ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034') ('4302', None, None, None, None, None, None, None, '2728034') ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 9 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, '22104991', 'None', None, None, None, None, '2728034'), ('4302', '22104991', '1350505026', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350504960', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350501830', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350497038', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496938', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496848', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350496652', None, None, None, None, None, '2728034'), ('4302', '22104991', '1350495399', None, None, None, None, None, '2728034')] time used for this insertion : 0.019750595092773438 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.3696868419647217 time spend to save output : 0.020012617111206055 total time spend for step 5 : 0.38969945907592773 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 (2728034) 2.22user 2.39system 0:06.11elapsed 75%CPU (0avgtext+0avgdata 158636maxresident)k 36808inputs+4496outputs (170major+71481minor)pagefaults 0swaps