insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22504021 , 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=22503951 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 (22504021) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504022 , 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=22503951 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 (22504022) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504023 , 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=22503951 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 (22504023) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504024 , 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=22503951 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='autre_refus' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22504024) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504025 , 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=22503951 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 (22504025) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504026 , 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=22503951 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 (22504026) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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 22504027 , 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=22503951 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 (22504027) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22503951) result : ((1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) 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`=22503951 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('papier','Carton_gris','kraft','Carton_brun','flou','mal_croppe','autre_refus','metal','cartonnette','environnement','plastique','Teint_Dans_La_Masse')) 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`=22503951 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('papier','Carton_gris','kraft','Carton_brun','flou','mal_croppe','autre_refus','metal','cartonnette','environnement','plastique','Teint_Dans_La_Masse')) AND mptpi.`min_score`=0.5 To do returned map {'kraft': {'main_port_id': 22503951, 'sub_port_id': 22504028, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942945, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'environnement': {'main_port_id': 22503951, 'sub_port_id': 22504029, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942946, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'mal_croppe': {'main_port_id': 22503951, 'sub_port_id': 22504030, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942947, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'plastique': {'main_port_id': 22503951, 'sub_port_id': 22504031, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942948, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'Teint_Dans_La_Masse': {'main_port_id': 22503951, 'sub_port_id': 22504032, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942949, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'flou': {'main_port_id': 22503951, 'sub_port_id': 22504033, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942950, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'metal': {'main_port_id': 22503951, 'sub_port_id': 22504034, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942951, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'papier': {'main_port_id': 22503951, 'sub_port_id': 22504035, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942952, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'autre_refus': {'main_port_id': 22503951, 'sub_port_id': 22504036, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942953, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'Carton_brun': {'main_port_id': 22503951, 'sub_port_id': 22504037, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942954, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'cartonnette': {'main_port_id': 22503951, 'sub_port_id': 22504038, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942955, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 33, 30), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}, 'Carton_gris': {'main_port_id': 22503951, 'sub_port_id': 22504039, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14942956, 'last_updated_at': datetime.datetime(2025, 4, 29, 15, 34, 59), 'last_updated_at_desc': datetime.datetime(2025, 4, 29, 15, 34, 59), 'last_updated_at_asc': datetime.datetime(2025, 4, 29, 15, 33, 30)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504028,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504016 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504029,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504017 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504030,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504018 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504031,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504019 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504032,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504020 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504033,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504021 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504034,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504022 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504035,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504023 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504036,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504024 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504037,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504025 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504038,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504026 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22504039,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22504027 lien utilise dans velours : https://www.fotonower.com/velours/22504028,22504029,22504030,22504031,22504032,22504033,22504034,22504035,22504036,22504037,22504038,22504039?tags=kraft,environnement,mal_croppe,plastique,Teint_Dans_La_Masse,flou,metal,papier,autre_refus,Carton_brun,cartonnette,Carton_gris After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22503951]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] map_info['map_portfolio_photo'] : {22503951: [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253, 1354296002, 1354295971, 1354295432, 1354295403, 1354295373, 1354295096, 1354295063, 1354295044, 1354295041, 1354295037, 1354295031, 1354294980, 1354294960, 1354294951]} final : False mtd_id 4302 list_pids : [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] Looping around the photos to save general results len do output : 1 /22503951. 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, '2769508') ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 10 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, '22503951', "{'kraft': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027}", None, None, None, None, '2769508'), ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508')] time used for this insertion : 0.013948440551757812 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.3862872123718262 time spend to save output : 0.014248847961425781 total time spend for step 1 : 1.400536060333252 step2:final Tue Apr 29 15:36:29 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 (22503951) 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 22503951 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1354294980,1354294960,1354294951,1354295096,1354295063,1354295044,1354295041,1354295037,1354295031,1354295432,1354295403,1354295373,1354296002,1354295971,1354296271,1354296267,1354296263,1354296259,1354296255,1354296253,1354296418,1354296406,1354296384); 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([22503951]) Inside saveOutput : final : False verbose : True original output for save of step final : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} new output for save of step final : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] map_info['map_portfolio_photo'] : {22503951: [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253, 1354296002, 1354295971, 1354295432, 1354295403, 1354295373, 1354295096, 1354295063, 1354295044, 1354295041, 1354295037, 1354295031, 1354294980, 1354294960, 1354294951]} final : False mtd_id 4302 list_pids : [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] Looping around the photos to save general results len do output : 9 /1354296418.Didn't retrieve data . /1354296406.Didn't retrieve data . /1354296384.Didn't retrieve data . /1354296271.Didn't retrieve data . /1354296267.Didn't retrieve data . /1354296263.Didn't retrieve data . /1354296259.Didn't retrieve data . /1354296255.Didn't retrieve data . /1354296253.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, '2769508') ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 27 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', '22503951', '1354296418', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296406', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296384', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296271', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296267', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296263', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296259', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296255', '0.009469290453300626', None, None, None, None, '2769508'), ('4302', '22503951', '1354296253', '0.009469290453300626', None, None, None, None, '2769508')] time used for this insertion : 0.013255834579467773 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.06716346740722656 time spend to save output : 0.013757467269897461 total time spend for step 2 : 0.08092093467712402 step3:velours_tree Tue Apr 29 15:36:29 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 : {22503951: [{'kraft': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027}]} input_args_next_step : {22503951: ()} output_args : {22503951: [{'kraft': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027}]} args : 22503951 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': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22503951) 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([22503951]) 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.35390472412109375 time spend to save output : 5.245208740234375e-05 total time spend for step 3 : 0.3539571762084961 step4:send_mail_cod Tue Apr 29 15:36:30 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 : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} input_args_next_step : {1354296418: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296418 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296406 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296384 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296271 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296267 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296263 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296259 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296255 depend.output_id : 0 input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ()} output_args : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',)} args : 1354296253 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 : {22503951: [{'kraft': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027}]} input_args_next_step : {1354296418: ('0.009469290453300626',), 1354296406: ('0.009469290453300626',), 1354296384: ('0.009469290453300626',), 1354296271: ('0.009469290453300626',), 1354296267: ('0.009469290453300626',), 1354296263: ('0.009469290453300626',), 1354296259: ('0.009469290453300626',), 1354296255: ('0.009469290453300626',), 1354296253: ('0.009469290453300626',), 22503951: ()} output_args : {22503951: [{'kraft': 22504016, 'environnement': 22504017, 'mal_croppe': 22504018, 'plastique': 22504019, 'Teint_Dans_La_Masse': 22504020, 'flou': 22504021, 'metal': 22504022, 'papier': 22504023, 'autre_refus': 22504024, 'Carton_brun': 22504025, 'cartonnette': 22504026, 'Carton_gris': 22504027}]} args : 22503951 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 :10, first value : ('0.009469290453300626',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22503951) 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 (1354296418,1354296406,1354296384,1354296271,1354296267,1354296263,1354296259,1354296255,1354296253) Found this number of photos: 9 ##### Call download_photos : nb_thread : 5 begin to download photo : 1354296253 begin to download photo : 1354296259 begin to download photo : 1354296267 begin to download photo : 1354296384 begin to download photo : 1354296418 download finish for photo 1354296384 begin to download photo : 1354296406 download finish for photo 1354296259 begin to download photo : 1354296263 download finish for photo 1354296253 begin to download photo : 1354296255 download finish for photo 1354296267 begin to download photo : 1354296271 download finish for photo 1354296418 download finish for photo 1354296406 download finish for photo 1354296263 download finish for photo 1354296271 download finish for photo 1354296255 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette225040161745933790/ imagette225040181745933790/ imagette225040191745933790/ imagette225040211745933790/ imagette225040221745933790/ imagette225040241745933790/ imagette225040261745933790/ length of list_filenames : 9 ; length of list_pids : 9 ; length of list_args : 9 results_Auto_P22503951_29-04-2025_15_36_30.pdf 22504016 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=22504016 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040161745933790 22504018 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=22504018 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040181745933790 22504019 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=22504019 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040191745933790 22504021 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=22504021 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040211745933790 22504022 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=22504022 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040221745933790 22504024 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=22504024 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040241745933790 22504026 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=22504026 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040261745933790 22504020 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=22504020 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1354296281: '1745933713_145209_1354295403_33be4d894674f370f8f5035c1c55143a_rle_crop_3773193896_0.png'} change filename to text .imagette225040201745933790/ imagette225040201745933790/1745933713_145209_1354295403_33be4d894674f370f8f5035c1c55143a_rle_crop_3773193896_0.png.png imagette225040251745933790/ imagette225040271745933790/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/29/621e2ea2f4aff168a5a519e7b232bebb_10324675.png imagette225040201745933790 22504025 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=22504025 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040251745933790 22504027 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=22504027 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette225040271745933790 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22503951 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22504028,22504029,22504030,22504031,22504032,22504033,22504034,22504035,22504036,22504037,22504038,22504039?tags=kraft,environnement,mal_croppe,plastique,Teint_Dans_La_Masse,flou,metal,papier,autre_refus,Carton_brun,cartonnette,Carton_gris your option no_mail is active, we will not send the real mail to your client args[1354296418] : ('0.009469290453300626',) no score found for photo 1354296418 We are sending mail with results at report@fotonower.com args[1354296406] : ('0.009469290453300626',) no score found for photo 1354296406 We are sending mail with results at report@fotonower.com args[1354296384] : ('0.009469290453300626',) no score found for photo 1354296384 We are sending mail with results at report@fotonower.com args[1354296271] : ('0.009469290453300626',) no score found for photo 1354296271 We are sending mail with results at report@fotonower.com args[1354296267] : ('0.009469290453300626',) no score found for photo 1354296267 We are sending mail with results at report@fotonower.com args[1354296263] : ('0.009469290453300626',) no score found for photo 1354296263 We are sending mail with results at report@fotonower.com args[1354296259] : ('0.009469290453300626',) no score found for photo 1354296259 We are sending mail with results at report@fotonower.com args[1354296255] : ('0.009469290453300626',) no score found for photo 1354296255 We are sending mail with results at report@fotonower.com args[1354296253] : ('0.009469290453300626',) no score found for photo 1354296253 We are sending mail with results at report@fotonower.com refus_total : 0.009469290453300626 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=22503951 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_P22503951_29-04-2025_15_36_30.pdf results_Auto_P22503951_29-04-2025_15_36_30.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503951_29-04-2025_15_36_30.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','22503951','results_Auto_P22503951_29-04-2025_15_36_30.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503951_29-04-2025_15_36_30.pdf','pdf','','0.1','0.009469290453300626') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22503951]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] map_info['map_portfolio_photo'] : {22503951: [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253, 1354296002, 1354295971, 1354295432, 1354295403, 1354295373, 1354295096, 1354295063, 1354295044, 1354295041, 1354295037, 1354295031, 1354294980, 1354294960, 1354294951]} final : False mtd_id 4302 list_pids : [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] 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, '2769508') ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508') 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', '22503951', '1354296418', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508')] time used for this insertion : 0.016089916229248047 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.3196995258331299 time spend to save output : 0.016407251358032227 total time spend for step 4 : 1.336106777191162 step5:split_time_score Tue Apr 29 15:36:31 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 : ['22503951'] 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 : [('22503951',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22503951) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1354296418: {'path': 'temp/1745933790_2619472_1354296418_a9b465cf100fdaec3b4fec27135964f6.jpg', 'extension': 'jpg'}, 1354296384: {'path': 'temp/1745933790_2619472_1354296384_8a5d7196fbbf6e688d29791f156e2388.jpg', 'extension': 'jpg'}, 1354296406: {'path': 'temp/1745933790_2619472_1354296406_b3d2b39472e5ac673b77c150fea16d5a.jpg', 'extension': 'jpg'}, 1354296259: {'path': 'temp/1745933790_2619472_1354296259_d22c4c781ec58fd7ade7686b2db0df70.jpg', 'extension': 'jpg'}, 1354296263: {'path': 'temp/1745933790_2619472_1354296263_8f8e8a94c70e366213dad10413774b9c.jpg', 'extension': 'jpg'}, 1354296267: {'path': 'temp/1745933790_2619472_1354296267_7ace6ab2fc6fcff918765aa52344b3b8.jpg', 'extension': 'jpg'}, 1354296271: {'path': 'temp/1745933790_2619472_1354296271_13a5885d2880517b7b03509903a4bd08.jpg', 'extension': 'jpg'}, 1354296253: {'path': 'temp/1745933790_2619472_1354296253_17fbb49ed5eafbc526e306db7e44026e.jpg', 'extension': 'jpg'}, 1354296255: {'path': 'temp/1745933790_2619472_1354296255_e2a4222ab1987a4a3d37f6345e81ba81.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 = 22503951; (('arc_en_ciel_jrm_live',),) 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 = 22503951 group by h (('15', 23),) 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=22503951 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 (22503951) 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 (22503951) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 29042025 22503951 Nombre de photos uploadées : 23 / 23040 (0%) 29042025 22503951 Nombre de photos taguées (types de déchets): 0 / 23 (0%) 29042025 22503951 Nombre de photos taguées (volume) : 0 / 23 (0%) [{'photo_id': 1354294980, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/29/568659c86a40ca0875e191e82fc5c175.jpg', 'username': None, 'uploaded_at': 1745933467, 'text': 'image_29042025_15_30_04_010147m0.jpg 1e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1354294960, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/29/78445b9a0a523d1d7701d4ed8649d689.jpg', 'username': None, 'uploaded_at': 1745933467, 'text': 'image_29042025_15_30_14_010135m0.jpg 2e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1354294951, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/29/e79199d1b7530f11950055cfbc5f9fc1.jpg', 'username': None, 'uploaded_at': 1745933467, 'text': 'image_29042025_15_30_45_010133m0.jpg 3.0000000000000004e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1354295096, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/29/932279f737d2fe25e9bd63aba4840e2e.jpg', 'username': None, 'uploaded_at': 1745933527, 'text': 'image_29042025_15_30_55_10138.jpg'}] 0 [] elapsed_time : load_data_split_time_score 1.430511474609375e-06 elapsed_time : order_list_meta_photo_and_scores 4.0531158447265625e-06 ??????????????????????? elapsed_time : fill_and_build_computed_from_old_data 0.0010623931884765625 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 218, 22503951, '2025-04-29' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1755242,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.027187824249267578 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= 1755242 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1755242, 'dashboard_run_id': 1762750, 'mtr_portfolio_id': 22501536, 'dashboard_result_id': 10142514, '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_P22501536_29-04-2025_15_02_59.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22501541, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22501542, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22501543, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22501544, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22501545, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22501546, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22501547, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22501548, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22501549, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22501550, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22501551, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22501552, 'pht': 3726}}"}, {'dashboat_entry_day': 1755242, 'dashboard_run_id': 1762750, 'mtr_portfolio_id': 22502359, 'dashboard_result_id': 10142515, '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_P22502359_29-04-2025_15_19_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22502417, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22502418, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22502419, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22502420, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22502421, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22502422, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22502423, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22502424, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22502425, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22502426, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22502427, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22502428, 'pht': 3726}}"}, {'dashboat_entry_day': 1755242, 'dashboard_run_id': 1762750, 'mtr_portfolio_id': 22503387, 'dashboard_result_id': 10142516, '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_P22503387_29-04-2025_15_33_01.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22503392, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22503393, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22503394, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22503395, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22503396, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22503397, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22503398, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22503399, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22503400, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22503401, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22503402, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22503403, 'pht': 3726}}"}, {'dashboat_entry_day': 1755242, 'dashboard_run_id': 1762750, 'mtr_portfolio_id': 22503951, 'dashboard_result_id': 10142517, '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_P22503951_29-04-2025_15_34_59.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22504016, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22504017, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22504018, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22504019, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22504020, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22504021, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22504022, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22504023, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22504024, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22504025, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22504026, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22504027, 'pht': 3726}}"}] SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22501536 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': 2769301, 'mtr_portfolio_id': 22501536, 'created_at': datetime.datetime(2025, 4, 29, 15, 2, 59), 'result': '0.0475483350231047', 'result_long': None, 'result_double': None}] Qualite : 0.0475483350231047 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22501536 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22501536_29-04-2025_15_02_59.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22501536 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_P22501536_29-04-2025_15_02_59.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22501541, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22501542, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22501543, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22501544, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22501545, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22501546, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22501547, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22501548, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22501549, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22501550, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22501551, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22501552, 'pht': 3726}}" where mtr_portfolio_id = 22501536 and dashboard_run_id = 1762750 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`=22501536 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10142514, 0.0475483350231047, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22501536_29-04-2025_15_02_59.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22501541, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22501542, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22501543, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22501544, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22501545, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22501546, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22501547, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22501548, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22501549, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22501550, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22501551, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22501552, '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 = 22502359 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': 2769361, 'mtr_portfolio_id': 22502359, 'created_at': datetime.datetime(2025, 4, 29, 15, 19), 'result': '0.04071772312185362', 'result_long': None, 'result_double': None}] Qualite : 0.04071772312185362 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22502359 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22502359_29-04-2025_15_19_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22502359 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_P22502359_29-04-2025_15_19_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22502417, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22502418, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22502419, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22502420, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22502421, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22502422, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22502423, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22502424, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22502425, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22502426, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22502427, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22502428, 'pht': 3726}}" where mtr_portfolio_id = 22502359 and dashboard_run_id = 1762750 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`=22502359 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10142515, 0.04071772312185362, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22502359_29-04-2025_15_19_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22502417, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22502418, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22502419, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22502420, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22502421, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22502422, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22502423, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22502424, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22502425, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22502426, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22502427, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22502428, '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 = 22503387 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': 2769432, 'mtr_portfolio_id': 22503387, 'created_at': datetime.datetime(2025, 4, 29, 15, 33, 1), 'result': '0.05012430156165207', 'result_long': None, 'result_double': None}] Qualite : 0.05012430156165207 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22503387 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503387_29-04-2025_15_33_01.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22503387 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_P22503387_29-04-2025_15_33_01.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22503392, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22503393, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22503394, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22503395, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22503396, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22503397, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22503398, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22503399, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22503400, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22503401, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22503402, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22503403, 'pht': 3726}}" where mtr_portfolio_id = 22503387 and dashboard_run_id = 1762750 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`=22503387 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10142516, 0.05012430156165207, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503387_29-04-2025_15_33_01.pdf', 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22503392, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22503393, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22503394, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22503395, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22503396, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22503397, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22503398, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22503399, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22503400, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22503401, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22503402, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22503403, '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 = 22503951 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': 2769508, 'mtr_portfolio_id': 22503951, 'created_at': datetime.datetime(2025, 4, 29, 15, 36, 29), 'result': '0.009469290453300626', 'result_long': None, 'result_double': None}] Qualite : 0.009469290453300626 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22503951 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503951_29-04-2025_15_36_30.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22503951 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_P22503951_29-04-2025_15_36_30.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22504016, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22504017, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22504018, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22504019, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22504020, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22504021, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22504022, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22504023, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22504024, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22504025, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22504026, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22504027, 'pht': 3726}}" where mtr_portfolio_id = 22503951 and dashboard_run_id = 1762750 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`=22503951 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10142517, 0.009469290453300626, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22503951_29-04-2025_15_36_30.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22504016, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22504017, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22504018, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22504019, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22504020, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22504021, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22504022, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22504023, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22504024, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22504025, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22504026, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22504027, '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 (22501536,22502359,22503387,22503951) result : ((1354272529,), (1354273024,), (1354273114,), (1354274754,), (1354274822,), (1354274825,), (1354274830,), (1354275227,), (1354276477,), (1354276499,), (1354276525,), (1354276565,), (1354277313,), (1354277369,), (1354277420,), (1354277448,), (1354277459,), (1354277689,), (1354277692,), (1354277694,), (1354277742,), (1354277766,), (1354277792,), (1354277821,), (1354277914,), (1354277941,), (1354278379,), (1354278407,), (1354278411,), (1354278455,), (1354278515,), (1354278552,), (1354278591,), (1354278616,), (1354278649,), (1354278755,), (1354278765,), (1354278798,), (1354278829,), (1354279367,), (1354279235,), (1354279267,), (1354279297,), (1354279326,), (1354280253,), (1354280330,), (1354280411,), (1354280494,), (1354281884,), (1354282040,), (1354282169,), (1354282304,), (1354282564,), (1354282671,), (1354283772,), (1354284302,), (1354284554,), (1354284602,), (1354284631,), (1354284934,), (1354285023,), (1354285105,), (1354285175,), (1354285948,), (1354286018,), (1354286071,), (1354286122,), (1354286169,), (1354286211,), (1354286445,), (1354286458,), (1354286472,), (1354286479,), (1354286721,), (1354286770,), (1354286834,), (1354287002,), (1354287120,), (1354287266,), (1354287715,), (1354287735,), (1354287739,), (1354287790,), (1354287883,), (1354287979,), (1354288267,), (1354288269,), (1354288275,), (1354288354,), (1354288360,), (1354288372,), (1354288524,), (1354288549,), (1354288678,), (1354288683,), (1354288912,), (1354288722,), (1354288727,), (1354288769,), (1354288829,), (1354289154,), (1354289334,), (1354289443,), (1354289559,), (1354289677,), (1354289795,), (1354290419,), (1354290445,), (1354290460,), (1354290493,), (1354290497,), (1354290501,), (1354290505,), (1354290508,), (1354290513,), (1354291256,), (1354291313,), (1354291366,), (1354291417,), (1354291456,), (1354291840,), (1354291894,), (1354291948,), (1354292346,), (1354292376,), (1354292407,), (1354292466,), (1354292576,), (1354292695,), (1354293062,), (1354293114,), (1354293175,), (1354293232,), (1354293559,), (1354293564,), (1354293566,), (1354293573,), (1354293576,), (1354293580,), (1354293614,), (1354293619,), (1354293621,), (1354293623,), (1354293657,), (1354293683,), (1354293710,), (1354293744,), (1354293773,), (1354293851,), (1354294052,), (1354294081,), (1354294108,), (1354294135,), (1354294377,), (1354294380,), (1354294383,), (1354294385,), (1354294387,), (1354294392,), (1354294522,), (1354294525,), (1354294532,), (1354294534,), (1354294598,), (1354294602,), (1354294605,), (1354294612,), (1354294647,), (1354294675,), (1354294981,), (1354294951,), (1354294960,), (1354294980,), (1354295031,), (1354295037,), (1354295041,), (1354295044,), (1354295063,), (1354295096,), (1354295373,), (1354295403,), (1354295432,), (1354295971,), (1354296002,), (1354296253,), (1354296255,), (1354296259,), (1354296263,), (1354296267,), (1354296271,), (1354296384,), (1354296406,), (1354296418,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'29042025': {'nb_upload': 23, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22503951]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] map_info['map_portfolio_photo'] : {22503951: [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253, 1354296002, 1354295971, 1354295432, 1354295403, 1354295373, 1354295096, 1354295063, 1354295044, 1354295041, 1354295037, 1354295031, 1354294980, 1354294960, 1354294951]} final : True mtd_id 4302 list_pids : [1354296418, 1354296406, 1354296384, 1354296271, 1354296267, 1354296263, 1354296259, 1354296255, 1354296253] Looping around the photos to save general results len do output : 1 /22503951Didn'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, '2769508') ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508') ('4302', None, None, None, None, None, None, None, '2769508') ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 10 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, '22503951', 'None', None, None, None, None, '2769508'), ('4302', '22503951', '1354296418', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296406', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296384', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296271', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296267', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296263', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296259', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296255', None, None, None, None, None, '2769508'), ('4302', '22503951', '1354296253', None, None, None, None, None, '2769508')] time used for this insertion : 0.03726983070373535 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.703833818435669 time spend to save output : 0.03797340393066406 total time spend for step 5 : 0.741807222366333 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 (2769508) 2.29user 1.99system 0:07.74elapsed 55%CPU (0avgtext+0avgdata 161068maxresident)k 2232inputs+5592outputs (35major+77843minor)pagefaults 0swaps