result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221384 , 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=22221379 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='metal' 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 (22221384) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221385 , 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=22221379 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 (22221385) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221386 , 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=22221379 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 (22221386) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221387 , 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=22221379 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 (22221387) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221388 , 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=22221379 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 (22221388) result : ((1351123745,), (1351123746,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221389 , 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=22221379 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 (22221389) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221390 , 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=22221379 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 (22221390) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221391 , 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=22221379 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='plastique' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221391) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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 22221392 , 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=22221379 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='mal_croppe' 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 (22221392) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22221379) result : ((1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) 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`=22221379 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('kraft','autre_refus','Teint_Dans_La_Masse','metal','Carton_gris','papier','cartonnette','Carton_brun','flou','environnement','plastique','mal_croppe')) 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`=22221379 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('kraft','autre_refus','Teint_Dans_La_Masse','metal','Carton_gris','papier','cartonnette','Carton_brun','flou','environnement','plastique','mal_croppe')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_4417_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_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__10042025_11_45_04_9132_4417_mal_croppe_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)[[22221379, 22221393, 4417, 0.5, 493202403, 979], [22221379, 22221394, 4417, 0.5, 2107752406, 979], [22221379, 22221395, 4417, 0.5, 2107752385, 979], [22221379, 22221396, 4417, 0.5, 492628673, 979], [22221379, 22221397, 4417, 0.5, 2107753020, 979], [22221379, 22221398, 4417, 0.5, 492668766, 979], [22221379, 22221399, 4417, 0.5, 702398920, 979], [22221379, 22221400, 4417, 0.5, 2107753024, 979], [22221379, 22221401, 4417, 0.5, 492777938, 979], [22221379, 22221402, 4417, 0.5, 493012381, 979], [22221379, 22221403, 4417, 0.5, 492725882, 979], [22221379, 22221404, 4417, 0.5, 2107755527, 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`=22221379 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('kraft','autre_refus','Teint_Dans_La_Masse','metal','Carton_gris','papier','cartonnette','Carton_brun','flou','environnement','plastique','mal_croppe')) 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`=22221379 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('kraft','autre_refus','Teint_Dans_La_Masse','metal','Carton_gris','papier','cartonnette','Carton_brun','flou','environnement','plastique','mal_croppe')) AND mptpi.`min_score`=0.5 To do returned map {'kraft': {'main_port_id': 22221379, 'sub_port_id': 22221393, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693045, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'autre_refus': {'main_port_id': 22221379, 'sub_port_id': 22221394, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693046, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'Teint_Dans_La_Masse': {'main_port_id': 22221379, 'sub_port_id': 22221395, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693047, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'metal': {'main_port_id': 22221379, 'sub_port_id': 22221396, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693048, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'Carton_gris': {'main_port_id': 22221379, 'sub_port_id': 22221397, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693049, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'papier': {'main_port_id': 22221379, 'sub_port_id': 22221398, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693050, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'cartonnette': {'main_port_id': 22221379, 'sub_port_id': 22221399, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693051, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'Carton_brun': {'main_port_id': 22221379, 'sub_port_id': 22221400, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693052, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'flou': {'main_port_id': 22221379, 'sub_port_id': 22221401, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693053, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'environnement': {'main_port_id': 22221379, 'sub_port_id': 22221402, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693054, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'plastique': {'main_port_id': 22221379, 'sub_port_id': 22221403, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693055, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}, 'mal_croppe': {'main_port_id': 22221379, 'sub_port_id': 22221404, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14693056, 'last_updated_at': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 10, 11, 50, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 10, 11, 50, 59)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221393,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221381 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221394,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221382 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221395,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221383 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221396,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221384 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221397,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221385 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221398,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221386 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221399,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221387 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221400,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221388 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221401,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221389 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221402,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221390 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221403,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221391 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22221404,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22221392 lien utilise dans velours : https://www.fotonower.com/velours/22221393,22221394,22221395,22221396,22221397,22221398,22221399,22221400,22221401,22221402,22221403,22221404?tags=kraft,autre_refus,Teint_Dans_La_Masse,metal,Carton_gris,papier,cartonnette,Carton_brun,flou,environnement,plastique,mal_croppe After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22221379]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] map_info['map_portfolio_photo'] : {22221379: [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066]} final : False mtd_id 4302 list_pids : [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] Looping around the photos to save general results len do output : 1 /22221379. 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, '2739324') ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324') 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, '22221379', "{'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392}", None, None, None, None, '2739324'), ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324')] time used for this insertion : 3.504549503326416 save_final save missing photos in datou_result : time spend for datou_step_exec : 2.244941473007202 time spend to save output : 3.5048162937164307 total time spend for step 1 : 5.749757766723633 step2:final Thu Apr 10 11:51:03 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 (22221379) 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 22221379 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1351123066,1351123473,1351123442,1351123418,1351123543,1351123538,1351123596,1351123593); 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([22221379]) Inside saveOutput : final : False verbose : True original output for save of step final : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} new output for save of step final : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] map_info['map_portfolio_photo'] : {22221379: [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066]} final : False mtd_id 4302 list_pids : [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] Looping around the photos to save general results len do output : 8 /1351123596.Didn't retrieve data . /1351123593.Didn't retrieve data . /1351123543.Didn't retrieve data . /1351123538.Didn't retrieve data . /1351123473.Didn't retrieve data . /1351123442.Didn't retrieve data . /1351123418.Didn't retrieve data . /1351123066.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, '2739324') ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324') 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', '22221379', '1351123596', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123593', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123543', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123538', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123473', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123442', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123418', '0.06570148653656152', None, None, None, None, '2739324'), ('4302', '22221379', '1351123066', '0.06570148653656152', None, None, None, None, '2739324')] time used for this insertion : 0.012545585632324219 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.027643442153930664 time spend to save output : 0.013103246688842773 total time spend for step 2 : 0.04074668884277344 step3:velours_tree Thu Apr 10 11:51:03 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 : {22221379: [{'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392}]} input_args_next_step : {22221379: ()} output_args : {22221379: [{'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392}]} args : 22221379 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 : ({'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22221379) 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([22221379]) 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.3239319324493408 time spend to save output : 5.5789947509765625e-05 total time spend for step 3 : 0.3239877223968506 step4:send_mail_cod Thu Apr 10 11:51:03 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 : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} input_args_next_step : {1351123596: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123596 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123593 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123543 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123538 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123473 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123442 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123418 depend.output_id : 0 input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ()} output_args : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',)} args : 1351123066 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 : {22221379: [{'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392}]} input_args_next_step : {1351123596: ('0.06570148653656152',), 1351123593: ('0.06570148653656152',), 1351123543: ('0.06570148653656152',), 1351123538: ('0.06570148653656152',), 1351123473: ('0.06570148653656152',), 1351123442: ('0.06570148653656152',), 1351123418: ('0.06570148653656152',), 1351123066: ('0.06570148653656152',), 22221379: ()} output_args : {22221379: [{'kraft': 22221381, 'autre_refus': 22221382, 'Teint_Dans_La_Masse': 22221383, 'metal': 22221384, 'Carton_gris': 22221385, 'papier': 22221386, 'cartonnette': 22221387, 'Carton_brun': 22221388, 'flou': 22221389, 'environnement': 22221390, 'plastique': 22221391, 'mal_croppe': 22221392}]} args : 22221379 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.06570148653656152',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22221379) 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 (1351123596,1351123593,1351123543,1351123538,1351123473,1351123442,1351123418,1351123066) Found this number of photos: 8 ##### Call download_photos : nb_thread : 5 begin to download photo : 1351123066 begin to download photo : 1351123442 begin to download photo : 1351123538 begin to download photo : 1351123593 download finish for photo 1351123442 begin to download photo : 1351123473 download finish for photo 1351123593 begin to download photo : 1351123596 download finish for photo 1351123066 begin to download photo : 1351123418 download finish for photo 1351123538 begin to download photo : 1351123543 download finish for photo 1351123596 download finish for photo 1351123418 download finish for photo 1351123543 download finish for photo 1351123473 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos length of list_filenames : 8 ; length of list_pids : 8 ; length of list_args : 8 results_Auto_P22221379_10-04-2025_11_51_04.pdf 22221381 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=22221381 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1351123750: '1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779043_0.png'} change filename to text .imagette222213811744278664/ imagette222213811744278664/1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779043_0.png.png imagette222213821744278664/ imagette222213841744278664/ imagette222213871744278664/ imagette222213891744278664/ imagette222213911744278664/ imagette222213921744278664/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/a1a3765e014dccd41e6d1ba34f1de90f_45277189.png imagette222213811744278664 22221382 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=22221382 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213821744278664 22221384 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=22221384 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213841744278664 22221387 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=22221387 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213871744278664 22221389 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=22221389 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213891744278664 22221391 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=22221391 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213911744278664 22221392 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=22221392 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213921744278664 22221383 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=22221383 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1351123741: '1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779046_0.png'} change filename to text .imagette222213831744278664/ imagette222213831744278664/1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779046_0.png.png imagette222213851744278664/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/42d764a92926e49bb24e1263921c7bd3_91658984.png imagette222213831744278664 22221385 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=22221385 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette222213851744278664 22221388 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=22221388 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1351123745: '1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779040_0.png', 1351123746: '1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779042_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/f669cce1c2c2fc43183176b679a1a7a0_93546026.png change filename to text .imagette222213881744278664/ imagette222213881744278664/1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779042_0.png.png imagette222213881744278664/1744278565_4164378_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7_rle_crop_3753779040_0.png.png wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/f719360f584d843204824f38a77b6510_94491254.png imagette222213881744278664 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22221379 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22221393,22221394,22221395,22221396,22221397,22221398,22221399,22221400,22221401,22221402,22221403,22221404?tags=kraft,autre_refus,Teint_Dans_La_Masse,metal,Carton_gris,papier,cartonnette,Carton_brun,flou,environnement,plastique,mal_croppe your option no_mail is active, we will not send the real mail to your client args[1351123596] : ('0.06570148653656152',) no score found for photo 1351123596 We are sending mail with results at report@fotonower.com args[1351123593] : ('0.06570148653656152',) no score found for photo 1351123593 We are sending mail with results at report@fotonower.com args[1351123543] : ('0.06570148653656152',) no score found for photo 1351123543 We are sending mail with results at report@fotonower.com args[1351123538] : ('0.06570148653656152',) no score found for photo 1351123538 We are sending mail with results at report@fotonower.com args[1351123473] : ('0.06570148653656152',) no score found for photo 1351123473 We are sending mail with results at report@fotonower.com args[1351123442] : ('0.06570148653656152',) no score found for photo 1351123442 We are sending mail with results at report@fotonower.com args[1351123418] : ('0.06570148653656152',) no score found for photo 1351123418 We are sending mail with results at report@fotonower.com args[1351123066] : ('0.06570148653656152',) no score found for photo 1351123066 We are sending mail with results at report@fotonower.com refus_total : 0.06570148653656152 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=22221379 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_P22221379_10-04-2025_11_51_04.pdf results_Auto_P22221379_10-04-2025_11_51_04.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22221379_10-04-2025_11_51_04.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','22221379','results_Auto_P22221379_10-04-2025_11_51_04.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22221379_10-04-2025_11_51_04.pdf','pdf','','0.1','0.06570148653656152') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22221379]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] map_info['map_portfolio_photo'] : {22221379: [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066]} final : False mtd_id 4302 list_pids : [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] 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, '2739324') ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324') 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', '22221379', '1351123596', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324')] time used for this insertion : 0.013654470443725586 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.587787389755249 time spend to save output : 0.013867616653442383 total time spend for step 4 : 1.6016550064086914 step5:split_time_score Thu Apr 10 11:51:05 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 : ['22221379'] 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 : [('22221379',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22221379) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1351123593: {'path': 'temp/1744278663_2178949_1351123593_4065af1fe136134bd285d0b49de1eb70.jpg', 'extension': 'jpg'}, 1351123596: {'path': 'temp/1744278663_2178949_1351123596_86f64a9ea17c16962e730d6de282be13.jpg', 'extension': 'jpg'}, 1351123066: {'path': 'temp/1744278663_2178949_1351123066_017149d1b360cf251a47181c8e26b26c.jpg', 'extension': 'jpg'}, 1351123418: {'path': 'temp/1744278663_2178949_1351123418_b2835b53da5af0ab718ffa8c4ae3a7c7.jpg', 'extension': 'jpg'}, 1351123538: {'path': 'temp/1744278663_2178949_1351123538_a17e82c38ebb9895bd2c850a667e515d.jpg', 'extension': 'jpg'}, 1351123543: {'path': 'temp/1744278663_2178949_1351123543_628f68c5dee07a275c3df478e434b48e.jpg', 'extension': 'jpg'}, 1351123442: {'path': 'temp/1744278663_2178949_1351123442_af2ebe7e705f5fc5f31b15717415592a.jpg', 'extension': 'jpg'}, 1351123473: {'path': 'temp/1744278663_2178949_1351123473_a4d4bc95c50fb73bbaac25e67005568f.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 = 22221379; (('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 = 22221379 group by h (('11', 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=22221379 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 (22221379) 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 (22221379) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 10042025 22221379 Nombre de photos uploadées : 8 / 23040 (0%) 10042025 22221379 Nombre de photos taguées (types de déchets): 0 / 8 (0%) 10042025 22221379 Nombre de photos taguées (volume) : 0 / 8 (0%) [{'photo_id': 1351123066, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/017149d1b360cf251a47181c8e26b26c.jpg', 'username': None, 'uploaded_at': 1744278367, 'text': 'image_10042025_11_45_04_9131.jpg'}, {'photo_id': 1351123473, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/a4d4bc95c50fb73bbaac25e67005568f.jpg', 'username': None, 'uploaded_at': 1744278428, 'text': 'image_10042025_11_45_34_10133.jpg'}, {'photo_id': 1351123442, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/af2ebe7e705f5fc5f31b15717415592a.jpg', 'username': None, 'uploaded_at': 1744278428, 'text': 'image_10042025_11_46_05_10144.jpg'}, {'photo_id': 1351123418, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/10/b2835b53da5af0ab718ffa8c4ae3a7c7.jpg', 'username': None, 'uploaded_at': 1744278428, 'text': 'image_10042025_11_46_14_9125.jpg'}] 0 [] elapsed_time : load_data_split_time_score 3.337860107421875e-06 elapsed_time : order_list_meta_photo_and_scores 7.867813110351562e-06 ???????? elapsed_time : fill_and_build_computed_from_old_data 0.000484466552734375 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 22221379, '2025-04-10' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1728450,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.024517536163330078 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= 1728450 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1728450, 'dashboard_run_id': 1738270, 'mtr_portfolio_id': 22219271, 'dashboard_result_id': 9986688, '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_P22219271_10-04-2025_11_19_00.pdf', 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22219312, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22219313, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22219314, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22219315, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22219316, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22219317, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22219318, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22219319, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22219320, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22219321, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22219322, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22219323, 'pht': 3726}}"}, {'dashboat_entry_day': 1728450, 'dashboard_run_id': 1738270, 'mtr_portfolio_id': 22220228, 'dashboard_result_id': 9986689, '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_P22220228_10-04-2025_11_33_04.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220249, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220250, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220251, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220252, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220253, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220254, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220255, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220256, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220257, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220258, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220259, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220260, 'pht': 3726}}"}, {'dashboat_entry_day': 1728450, 'dashboard_run_id': 1738270, 'mtr_portfolio_id': 22220968, 'dashboard_result_id': 9986690, '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_P22220968_10-04-2025_11_46_35.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220973, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220974, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220975, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220976, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220977, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220978, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220979, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220980, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220981, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220982, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220983, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220984, 'pht': 3726}}"}, {'dashboat_entry_day': 1728450, 'dashboard_run_id': 1738270, 'mtr_portfolio_id': 22221379, 'dashboard_result_id': 9986691, '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 = 22219271 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': 2739174, 'mtr_portfolio_id': 22219271, 'created_at': datetime.datetime(2025, 4, 10, 11, 19), 'result': '0.0321232377524789', 'result_long': None, 'result_double': None}] Qualite : 0.0321232377524789 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22219271 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22219271_10-04-2025_11_19_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22219271 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_P22219271_10-04-2025_11_19_00.pdf', 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22219312, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22219313, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22219314, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22219315, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22219316, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22219317, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22219318, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22219319, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22219320, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22219321, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22219322, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22219323, 'pht': 3726}}" where mtr_portfolio_id = 22219271 and dashboard_run_id = 1738270 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`=22219271 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9986688, 0.0321232377524789, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22219271_10-04-2025_11_19_00.pdf', 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22219312, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22219313, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22219314, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22219315, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22219316, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22219317, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22219318, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22219319, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22219320, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22219321, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22219322, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22219323, '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 = 22220228 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': 2739222, 'mtr_portfolio_id': 22220228, 'created_at': datetime.datetime(2025, 4, 10, 11, 33, 3), 'result': '0.05603612102497995', 'result_long': None, 'result_double': None}] Qualite : 0.05603612102497995 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22220228 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22220228_10-04-2025_11_33_04.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22220228 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_P22220228_10-04-2025_11_33_04.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220249, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220250, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220251, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220252, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220253, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220254, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220255, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220256, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220257, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220258, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220259, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220260, 'pht': 3726}}" where mtr_portfolio_id = 22220228 and dashboard_run_id = 1738270 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`=22220228 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9986689, 0.05603612102497995, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22220228_10-04-2025_11_33_04.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220249, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220250, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220251, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220252, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220253, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220254, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220255, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220256, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220257, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220258, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220259, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220260, '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 = 22220968 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': 2739298, 'mtr_portfolio_id': 22220968, 'created_at': datetime.datetime(2025, 4, 10, 11, 46, 34), 'result': '0.0636232742177427', 'result_long': None, 'result_double': None}] Qualite : 0.0636232742177427 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22220968 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22220968_10-04-2025_11_46_35.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22220968 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_P22220968_10-04-2025_11_46_35.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220973, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220974, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220975, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220976, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220977, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220978, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220979, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220980, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220981, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220982, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220983, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220984, 'pht': 3726}}" where mtr_portfolio_id = 22220968 and dashboard_run_id = 1738270 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`=22220968 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9986690, 0.0636232742177427, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22220968_10-04-2025_11_46_35.pdf', 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22220973, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22220974, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22220975, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22220976, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22220977, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22220978, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22220979, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22220980, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22220981, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22220982, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22220983, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22220984, '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 = 22221379 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': 2739324, 'mtr_portfolio_id': 22221379, 'created_at': datetime.datetime(2025, 4, 10, 11, 51, 3), 'result': '0.06570148653656152', 'result_long': None, 'result_double': None}] Qualite : 0.06570148653656152 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22221379 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22221379_10-04-2025_11_51_04.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22221379 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_P22221379_10-04-2025_11_51_04.pdf'}" where mtr_portfolio_id = 22221379 and dashboard_run_id = 1738270 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`=22221379 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9986691, 0.06570148653656152, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22221379_10-04-2025_11_51_04.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22221381, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22221382, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22221383, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22221384, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22221385, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22221386, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22221387, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22221388, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22221389, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22221390, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22221391, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22221392, '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 (22219271,22220228,22220968,22221379) result : ((1351112061,), (1351112077,), (1351112436,), (1351112483,), (1351112565,), (1351113036,), (1351113088,), (1351113160,), (1351113242,), (1351113374,), (1351113729,), (1351113814,), (1351113846,), (1351113889,), (1351113994,), (1351114333,), (1351114375,), (1351114410,), (1351115399,), (1351115455,), (1351115581,), (1351115597,), (1351115986,), (1351115997,), (1351116061,), (1351116101,), (1351116145,), (1351116227,), (1351116348,), (1351116373,), (1351116397,), (1351116441,), (1351116464,), (1351116476,), (1351116538,), (1351116551,), (1351116553,), (1351116562,), (1351116660,), (1351116670,), (1351116701,), (1351116705,), (1351116708,), (1351116712,), (1351116863,), (1351116869,), (1351116896,), (1351116926,), (1351116948,), (1351116963,), (1351117092,), (1351117142,), (1351117153,), (1351117254,), (1351117260,), (1351117279,), (1351117294,), (1351117336,), (1351117355,), (1351117357,), (1351117362,), (1351117372,), (1351117396,), (1351117456,), (1351117444,), (1351117520,), (1351117660,), (1351117665,), (1351117676,), (1351117785,), (1351117799,), (1351117823,), (1351117830,), (1351117854,), (1351117863,), (1351117927,), (1351117954,), (1351117977,), (1351118014,), (1351118031,), (1351118160,), (1351118225,), (1351118318,), (1351118574,), (1351118583,), (1351118640,), (1351118654,), (1351118662,), (1351118835,), (1351118849,), (1351118857,), (1351118859,), (1351119169,), (1351119174,), (1351119186,), (1351119193,), (1351119196,), (1351119199,), (1351119230,), (1351119233,), (1351119238,), (1351119285,), (1351119306,), (1351119327,), (1351119341,), (1351119359,), (1351119587,), (1351119604,), (1351119609,), (1351119744,), (1351119748,), (1351119756,), (1351119763,), (1351119791,), (1351120048,), (1351119924,), (1351119928,), (1351119930,), (1351119993,), (1351121625,), (1351121628,), (1351121977,), (1351121996,), (1351122000,), (1351122004,), (1351122009,), (1351122068,), (1351122071,), (1351122076,), (1351122078,), (1351122083,), (1351122088,), (1351122136,), (1351122139,), (1351122145,), (1351122157,), (1351122201,), (1351122362,), (1351122564,), (1351122575,), (1351122579,), (1351122582,), (1351122604,), (1351122625,), (1351122726,), (1351122754,), (1351122780,), (1351122831,), (1351123095,), (1351123066,), (1351123418,), (1351123442,), (1351123473,), (1351123538,), (1351123543,), (1351123593,), (1351123596,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'10042025': {'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([22221379]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] map_info['map_portfolio_photo'] : {22221379: [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066]} final : True mtd_id 4302 list_pids : [1351123596, 1351123593, 1351123543, 1351123538, 1351123473, 1351123442, 1351123418, 1351123066] Looping around the photos to save general results len do output : 1 /22221379Didn'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, '2739324') ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324') ('4302', None, None, None, None, None, None, None, '2739324') ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324') 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, '22221379', 'None', None, None, None, None, '2739324'), ('4302', '22221379', '1351123596', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123593', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123543', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123538', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123473', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123442', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123418', None, None, None, None, None, '2739324'), ('4302', '22221379', '1351123066', None, None, None, None, None, '2739324')] time used for this insertion : 0.014498233795166016 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.4837496280670166 time spend to save output : 0.014754533767700195 total time spend for step 5 : 0.4985041618347168 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 (2739324) 2.21user 2.15system 0:10.85elapsed 40%CPU (0avgtext+0avgdata 160140maxresident)k 248inputs+4568outputs (37major+64090minor)pagefaults 0swaps