SELECT id, mtr_user_id, name, pb_hashtag_id, hashtag_id_list, button_legend_list, portfolio_id_lists, photo_hashtag_type, photo_desc_type, svm_limit, limit_tagging, is_public, live, created_at, updated_at, type_classification FROM MTRDatou.classification_theme WHERE `id` IN (2725) thcls : [{'id': 2725, 'mtr_user_id': 31, 'name': 'learn_qualipapia_rle_210302_2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Carton_brun,Carton_gris,Teint_Dans_La_Masse,autre_refus,cartonnette,environnement,kraft,metal,papier,plastique', 'svm_portfolios_learning': '3460440,3460441,3460446,3460434,3460439,3467416,3460442,3460443,3486028,3460445', 'photo_hashtag_type': 3410, 'photo_desc_type': 5186, 'type_classification': 'caffe', 'hashtag_id_list': '2107753024,2107753020,2107752385,2107752406,702398920,493012381,493202403,492628673,492668766,492725882'}] thcl {'id': 2725, 'mtr_user_id': 31, 'name': 'learn_qualipapia_rle_210302_2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Carton_brun,Carton_gris,Teint_Dans_La_Masse,autre_refus,cartonnette,environnement,kraft,metal,papier,plastique', 'svm_portfolios_learning': '3460440,3460441,3460446,3460434,3460439,3467416,3460442,3460443,3486028,3460445', 'photo_hashtag_type': 3410, 'photo_desc_type': 5186, 'type_classification': 'caffe', 'hashtag_id_list': '2107753024,2107753020,2107752385,2107752406,702398920,493012381,493202403,492628673,492668766,492725882'} Update svm_hashtag_type_desc : 5186 remove imagettes from duplicated photo Iterating over portfolio : 22092677 get user id for portfolio 22092677 get sub ptf for main ptf 22092677, type 3726 and hashtags ['flou', 'kraft', 'papier', 'metal', 'autre_refus', 'Carton_brun', 'Teint_Dans_La_Masse', 'mal_croppe', 'Carton_gris', 'environnement', 'plastique', 'cartonnette'] 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`=22092677 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_flou_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_kraft_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_papier_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_metal_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_autre_refus_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_Carton_brun_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_Teint_Dans_La_Masse_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_mal_croppe_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_Carton_gris_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_environnement_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_plastique_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_3726_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio INSERT IGNORE INTO MTRPhoto.mtr_port_to_port_ids (`mtr_portfolio_id_1`, `mtr_portfolio_id_2`, `type`, `min_score`, `hashtag_id`, `mtr_user_id`) VALUES (%s,%s,%s,%s,%s,%s)[[22092677, 22092682, 3726, 0.5, 492777938, 979], [22092677, 22092683, 3726, 0.5, 493202403, 979], [22092677, 22092684, 3726, 0.5, 492668766, 979], [22092677, 22092685, 3726, 0.5, 492628673, 979], [22092677, 22092686, 3726, 0.5, 2107752406, 979], [22092677, 22092687, 3726, 0.5, 2107753024, 979], [22092677, 22092688, 3726, 0.5, 2107752385, 979], [22092677, 22092689, 3726, 0.5, 2107755527, 979], [22092677, 22092690, 3726, 0.5, 2107753020, 979], [22092677, 22092691, 3726, 0.5, 493012381, 979], [22092677, 22092692, 3726, 0.5, 492725882, 979], [22092677, 22092693, 3726, 0.5, 702398920, 979]] SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 To do returned map {'flou': {'main_port_id': 22092677, 'sub_port_id': 22092682, 'hashtag': 'flou', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576820, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'kraft': {'main_port_id': 22092677, 'sub_port_id': 22092683, 'hashtag': 'kraft', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576821, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'papier': {'main_port_id': 22092677, 'sub_port_id': 22092684, 'hashtag': 'papier', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576822, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'metal': {'main_port_id': 22092677, 'sub_port_id': 22092685, 'hashtag': 'metal', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576823, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'autre_refus': {'main_port_id': 22092677, 'sub_port_id': 22092686, 'hashtag': 'autre_refus', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576824, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'Carton_brun': {'main_port_id': 22092677, 'sub_port_id': 22092687, 'hashtag': 'Carton_brun', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576825, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'Teint_Dans_La_Masse': {'main_port_id': 22092677, 'sub_port_id': 22092688, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576826, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'mal_croppe': {'main_port_id': 22092677, 'sub_port_id': 22092689, 'hashtag': 'mal_croppe', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576827, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'Carton_gris': {'main_port_id': 22092677, 'sub_port_id': 22092690, 'hashtag': 'Carton_gris', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576828, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'environnement': {'main_port_id': 22092677, 'sub_port_id': 22092691, 'hashtag': 'environnement', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576829, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'plastique': {'main_port_id': 22092677, 'sub_port_id': 22092692, 'hashtag': 'plastique', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576830, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}, 'cartonnette': {'main_port_id': 22092677, 'sub_port_id': 22092693, 'hashtag': 'cartonnette', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576831, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33)}} insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22092682 , 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=22092677 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 (22092682) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092683 , 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=22092677 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='kraft' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092683) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092684 , 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=22092677 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 (22092684) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092685 , 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=22092677 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 (22092685) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092686 , 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=22092677 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 (22092686) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092687 , 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=22092677 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 (22092687) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092688 , 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=22092677 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='Teint_Dans_La_Masse' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092688) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092689 , 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=22092677 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='mal_croppe' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092689) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092690 , 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=22092677 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 (22092690) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092691 , 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=22092677 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='environnement' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092691) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092692 , 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=22092677 AND mpp.mtr_photo_id=chi.photo_id AND chi.id=csp.crop_hashtag_id AND chi.score>0.5 AND chi.type=3726 AND chi.hashtag_id=h.hashtag_id AND h.hashtag='plastique' GROUP BY csp.crop_hashtag_id, csp.created_at order by csp.created_at desc) as a group by crop_hashtag_id; SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092692) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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 22092693 , 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=22092677 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 (22092693) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22092677) result : ((1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) 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`=22092677 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_flou_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_kraft_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_papier_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_metal_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_autre_refus_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_Carton_brun_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_Teint_Dans_La_Masse_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_mal_croppe_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_Carton_gris_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_environnement_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_plastique_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__07042025_08_30_04_009141_4417_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio INSERT IGNORE INTO MTRPhoto.mtr_port_to_port_ids (`mtr_portfolio_id_1`, `mtr_portfolio_id_2`, `type`, `min_score`, `hashtag_id`, `mtr_user_id`) VALUES (%s,%s,%s,%s,%s,%s)[[22092677, 22092694, 4417, 0.5, 492777938, 979], [22092677, 22092695, 4417, 0.5, 493202403, 979], [22092677, 22092696, 4417, 0.5, 492668766, 979], [22092677, 22092697, 4417, 0.5, 492628673, 979], [22092677, 22092698, 4417, 0.5, 2107752406, 979], [22092677, 22092699, 4417, 0.5, 2107753024, 979], [22092677, 22092700, 4417, 0.5, 2107752385, 979], [22092677, 22092701, 4417, 0.5, 2107755527, 979], [22092677, 22092702, 4417, 0.5, 2107753020, 979], [22092677, 22092703, 4417, 0.5, 493012381, 979], [22092677, 22092704, 4417, 0.5, 492725882, 979], [22092677, 22092705, 4417, 0.5, 702398920, 979]] SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=22092677 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('flou','kraft','papier','metal','autre_refus','Carton_brun','Teint_Dans_La_Masse','mal_croppe','Carton_gris','environnement','plastique','cartonnette')) AND mptpi.`min_score`=0.5 To do returned map {'flou': {'main_port_id': 22092677, 'sub_port_id': 22092694, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576832, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'kraft': {'main_port_id': 22092677, 'sub_port_id': 22092695, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576833, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'papier': {'main_port_id': 22092677, 'sub_port_id': 22092696, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576834, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'metal': {'main_port_id': 22092677, 'sub_port_id': 22092697, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576835, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'autre_refus': {'main_port_id': 22092677, 'sub_port_id': 22092698, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576836, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'Carton_brun': {'main_port_id': 22092677, 'sub_port_id': 22092699, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576837, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'Teint_Dans_La_Masse': {'main_port_id': 22092677, 'sub_port_id': 22092700, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576838, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'mal_croppe': {'main_port_id': 22092677, 'sub_port_id': 22092701, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576839, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'Carton_gris': {'main_port_id': 22092677, 'sub_port_id': 22092702, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576840, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'environnement': {'main_port_id': 22092677, 'sub_port_id': 22092703, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576841, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'plastique': {'main_port_id': 22092677, 'sub_port_id': 22092704, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576842, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}, 'cartonnette': {'main_port_id': 22092677, 'sub_port_id': 22092705, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14576843, 'last_updated_at': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_desc': datetime.datetime(2025, 4, 7, 8, 33, 2), 'last_updated_at_asc': datetime.datetime(2025, 4, 7, 8, 33, 2)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092694,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092682 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092695,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092683 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092696,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092684 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092697,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092685 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092698,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092686 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092699,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092687 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092700,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092688 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092701,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092689 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092702,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092690 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092703,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092691 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092704,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092692 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22092705,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22092693 lien utilise dans velours : https://www.fotonower.com/velours/22092694,22092695,22092696,22092697,22092698,22092699,22092700,22092701,22092702,22092703,22092704,22092705?tags=flou,kraft,papier,metal,autre_refus,Carton_brun,Teint_Dans_La_Masse,mal_croppe,Carton_gris,environnement,plastique,cartonnette After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22092677]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] map_info['map_portfolio_photo'] : {22092677: [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075]} final : False mtd_id 4302 list_pids : [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] Looping around the photos to save general results len do output : 1 /22092677. 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, '2727917') ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 9 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', None, '22092677', "{'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693}", None, None, None, None, '2727917'), ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917')] time used for this insertion : 0.013219594955444336 save_final save missing photos in datou_result : time spend for datou_step_exec : 2.9838576316833496 time spend to save output : 0.0134735107421875 total time spend for step 1 : 2.997331142425537 step2:final Mon Apr 7 08:33:02 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed 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 (22092677) 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 22092677 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1350249085,1350249081,1350249078,1350249075,1350249141,1350249135,1350249130,1350249127); After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22092677]) Inside saveOutput : final : False verbose : True original output for save of step final : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} new output for save of step final : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] map_info['map_portfolio_photo'] : {22092677: [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075]} final : False mtd_id 4302 list_pids : [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] Looping around the photos to save general results len do output : 8 /1350249141.Didn't retrieve data . /1350249135.Didn't retrieve data . /1350249130.Didn't retrieve data . /1350249127.Didn't retrieve data . /1350249085.Didn't retrieve data . /1350249081.Didn't retrieve data . /1350249078.Didn't retrieve data . /1350249075.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, '2727917') ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 24 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', '22092677', '1350249141', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249135', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249130', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249127', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249085', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249081', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249078', '0.0', None, None, None, None, '2727917'), ('4302', '22092677', '1350249075', '0.0', None, None, None, None, '2727917')] time used for this insertion : 0.013857364654541016 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.018903732299804688 time spend to save output : 0.01426553726196289 total time spend for step 2 : 0.03316926956176758 step3:velours_tree Mon Apr 7 08:33:02 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : {22092677: [{'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693}]} input_args_next_step : {22092677: ()} output_args : {22092677: [{'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693}]} args : 22092677 depend.output_id : 0 VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :1, first value : ({'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22092677) 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([22092677]) 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.34549880027770996 time spend to save output : 7.295608520507812e-05 total time spend for step 3 : 0.34557175636291504 step4:send_mail_cod Mon Apr 7 08:33:02 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed 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 : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} input_args_next_step : {1350249141: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249141 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249135 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249130 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249127 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249085 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249081 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249078 depend.output_id : 0 input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ()} output_args : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',)} args : 1350249075 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 : {22092677: [{'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693}]} input_args_next_step : {1350249141: ('0.0',), 1350249135: ('0.0',), 1350249130: ('0.0',), 1350249127: ('0.0',), 1350249085: ('0.0',), 1350249081: ('0.0',), 1350249078: ('0.0',), 1350249075: ('0.0',), 22092677: ()} output_args : {22092677: [{'flou': 22092682, 'kraft': 22092683, 'papier': 22092684, 'metal': 22092685, 'autre_refus': 22092686, 'Carton_brun': 22092687, 'Teint_Dans_La_Masse': 22092688, 'mal_croppe': 22092689, 'Carton_gris': 22092690, 'environnement': 22092691, 'plastique': 22092692, 'cartonnette': 22092693}]} args : 22092677 depend.output_id : 0 We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :9, first value : ('0.0',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22092677) 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 (1350249141,1350249135,1350249130,1350249127,1350249085,1350249081,1350249078,1350249075) Found this number of photos: 8 ##### Call download_photos : nb_thread : 5 begin to download photo : 1350249075 begin to download photo : 1350249081 begin to download photo : 1350249127 begin to download photo : 1350249135 download finish for photo 1350249075 begin to download photo : 1350249078 download finish for photo 1350249135 begin to download photo : 1350249141 download finish for photo 1350249127 begin to download photo : 1350249130 download finish for photo 1350249081 begin to download photo : 1350249085 download finish for photo 1350249141 download finish for photo 1350249085 download finish for photo 1350249078 download finish for photo 1350249130 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette220926821744007583/ imagette220926831744007583/ imagette220926851744007583/ imagette220926861744007583/ imagette220926891744007583/ imagette220926921744007583/ imagette220926931744007583/ imagette220926871744007583/ imagette220926881744007583/ imagette220926901744007583/ length of list_filenames : 8 ; length of list_pids : 8 ; length of list_args : 8 results_Auto_P22092677_07-04-2025_08_33_03.pdf 22092682 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=22092682 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926821744007583 22092683 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=22092683 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926831744007583 22092685 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=22092685 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926851744007583 22092686 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=22092686 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926861744007583 22092689 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=22092689 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926891744007583 22092692 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=22092692 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926921744007583 22092693 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=22092693 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926931744007583 22092687 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=22092687 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926871744007583 22092688 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=22092688 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926881744007583 22092690 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=22092690 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette220926901744007583 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22092677 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22092694,22092695,22092696,22092697,22092698,22092699,22092700,22092701,22092702,22092703,22092704,22092705?tags=flou,kraft,papier,metal,autre_refus,Carton_brun,Teint_Dans_La_Masse,mal_croppe,Carton_gris,environnement,plastique,cartonnette your option no_mail is active, we will not send the real mail to your client args[1350249141] : ('0.0',) no score found for photo 1350249141 We are sending mail with results at report@fotonower.com args[1350249135] : ('0.0',) no score found for photo 1350249135 We are sending mail with results at report@fotonower.com args[1350249130] : ('0.0',) no score found for photo 1350249130 We are sending mail with results at report@fotonower.com args[1350249127] : ('0.0',) no score found for photo 1350249127 We are sending mail with results at report@fotonower.com args[1350249085] : ('0.0',) no score found for photo 1350249085 We are sending mail with results at report@fotonower.com args[1350249081] : ('0.0',) no score found for photo 1350249081 We are sending mail with results at report@fotonower.com args[1350249078] : ('0.0',) no score found for photo 1350249078 We are sending mail with results at report@fotonower.com args[1350249075] : ('0.0',) no score found for photo 1350249075 We are sending mail with results at report@fotonower.com refus_total : 0.0 2022-04-13 10:29:59 0 SELECT ph.photo_id,ph.url,ph.username,ph.uploaded_at,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22092677 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_P22092677_07-04-2025_08_33_03.pdf results_Auto_P22092677_07-04-2025_08_33_03.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22092677_07-04-2025_08_33_03.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','22092677','results_Auto_P22092677_07-04-2025_08_33_03.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22092677_07-04-2025_08_33_03.pdf','pdf','','0.09','0.0') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22092677]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] map_info['map_portfolio_photo'] : {22092677: [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075]} final : False mtd_id 4302 list_pids : [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] 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, '2727917') ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 8 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', '22092677', '1350249141', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917')] time used for this insertion : 0.012931108474731445 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.3390445709228516 time spend to save output : 0.013132810592651367 total time spend for step 4 : 1.352177381515503 step5:split_time_score Mon Apr 7 08:33:04 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 : ['22092677'] 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 : [('22092677',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22092677) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1350249135: {'path': 'temp/1744007582_3510109_1350249135_a1ba071856ef754d3da86ba9379613bf.jpg', 'extension': 'jpg'}, 1350249141: {'path': 'temp/1744007582_3510109_1350249141_9b444d2a9d1a1eda4a9ea44dffc43333.jpg', 'extension': 'jpg'}, 1350249081: {'path': 'temp/1744007582_3510109_1350249081_03dfb54edfaa02b70d41aa22d5738d52.jpg', 'extension': 'jpg'}, 1350249085: {'path': 'temp/1744007582_3510109_1350249085_47b3715b9a9dd6e8e1f1505cd69cec3e.jpg', 'extension': 'jpg'}, 1350249075: {'path': 'temp/1744007582_3510109_1350249075_97b657082c70fa3b2ffb12b7c3ff66dd.jpg', 'extension': 'jpg'}, 1350249078: {'path': 'temp/1744007582_3510109_1350249078_ba579122b54f2b680dfe4397e456fad4.jpg', 'extension': 'jpg'}, 1350249127: {'path': 'temp/1744007582_3510109_1350249127_d45b6bf9307646fc988138c4dae5c568.jpg', 'extension': 'jpg'}, 1350249130: {'path': 'temp/1744007582_3510109_1350249130_b9c6e7262f1f405e8498e70b1731f49a.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 = 22092677; (('arc_en_ciel_jrm',),) TODO : Insert select and so on Begin split_port_in_batch_balle thcls : [{'id': 861, 'mtr_user_id': 31, 'name': 'Rungis_class_dechets_1212', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Rungis_Aluminium,Rungis_Carton,Rungis_Papier,Rungis_Plastique_clair,Rungis_Plastique_dur,Rungis_Plastique_fonce,Rungis_Tapis_vide,Rungis_Tetrapak', 'svm_portfolios_learning': '1160730,571842,571844,571839,571933,571840,571841,572307', 'photo_hashtag_type': 999, 'photo_desc_type': 3963, 'type_classification': 'caffe', 'hashtag_id_list': '2107751280,2107750907,2107750908,2107750909,2107750910,2107750911,2107750912,2107750913'}] thcls : [{'id': 758, 'mtr_user_id': 31, 'name': 'Rungis_amount_dechets_fall_2018_v2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': '05102018_Papier_non_papier_dense,05102018_Papier_non_papier_peu_dense,05102018_Papier_non_papier_presque_vide,05102018_Papier_non_papier_tres_dense,05102018_Papier_non_papier_tres_peu_dense', 'svm_portfolios_learning': '1108385,1108386,1108388,1108384,1108387', 'photo_hashtag_type': 856, 'photo_desc_type': 3853, 'type_classification': 'caffe', 'hashtag_id_list': '2107751013,2107751014,2107751015,2107751016,2107751017'}] select SUBSTRING(ph.text,16,2) as h, count(*) from MTRUser.mtr_portfolio_photos mpp inner join MTRBack.photos ph on mpp.mtr_photo_id = ph.photo_id where mpp.mtr_portfolio_id = 22092677 group by h (('08', 8),) SELECT ph.photo_id,ph.url,ph.username,ph.uploaded_at,ph.text FROM MTRBack.photos ph, MTRUser.mtr_portfolio_photos mpp WHERE ph.photo_id=mpp.mtr_photo_id AND mpp.mtr_portfolio_id=22092677 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 (22092677) 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 (22092677) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 07042025 22092677 Nombre de photos uploadées : 8 / 23040 (0%) 07042025 22092677 Nombre de photos taguées (types de déchets): 0 / 8 (0%) 07042025 22092677 Nombre de photos taguées (volume) : 0 / 8 (0%) [{'photo_id': 1350249085, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/47b3715b9a9dd6e8e1f1505cd69cec3e.jpg', 'username': None, 'uploaded_at': 1744007468, 'text': 'image_07042025_08_30_04_9141.jpg'}, {'photo_id': 1350249081, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/03dfb54edfaa02b70d41aa22d5738d52.jpg', 'username': None, 'uploaded_at': 1744007468, 'text': 'image_07042025_08_30_24_10136.jpg'}, {'photo_id': 1350249078, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/ba579122b54f2b680dfe4397e456fad4.jpg', 'username': None, 'uploaded_at': 1744007468, 'text': 'image_07042025_08_30_34_10135.jpg'}, {'photo_id': 1350249075, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/4/7/97b657082c70fa3b2ffb12b7c3ff66dd.jpg', 'username': None, 'uploaded_at': 1744007468, 'text': 'image_07042025_08_30_44_10137.jpg'}] 0 [] elapsed_time : load_data_split_time_score 2.384185791015625e-06 elapsed_time : order_list_meta_photo_and_scores 5.9604644775390625e-06 ???????? elapsed_time : fill_and_build_computed_from_old_data 0.000492095947265625 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 22092677, '2025-04-07' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1719143,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.02848649024963379 We will return after consolidate but for now we need the day, how to get it, for now depending on the previous heavy steps SELECT dri.dashboard_entry_day, dr.dashboard_run_id, dr.mtr_portfolio_id, dr.id, dr.hashtag, dr.completion_json FROM MTRPhoto.dashboard_results dr, MTRPhoto.dashboard_run_ids dri, MTRPhoto.dashboard_entry_day ded WHERE ded.id= 1719143 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1719143, 'dashboard_run_id': 1726970, 'mtr_portfolio_id': 22091054, 'dashboard_result_id': 9898982, '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_P22091054_07-04-2025_08_02_58.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091058, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091059, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091060, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091061, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091062, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091063, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091064, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091065, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091066, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091067, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091068, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091069, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1726970, 'mtr_portfolio_id': 22091666, 'dashboard_result_id': 9898983, '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_P22091666_07-04-2025_08_17_30.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091670, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091671, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091672, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091673, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091674, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091675, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091676, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091677, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091678, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091679, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091680, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091681, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1726970, 'mtr_portfolio_id': 22092221, 'dashboard_result_id': 9898984, '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_P22092221_07-04-2025_08_31_00.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22092273, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22092274, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22092275, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22092276, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22092277, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22092278, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22092279, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22092280, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22092281, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22092282, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22092283, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22092284, 'pht': 3726}}"}, {'dashboat_entry_day': 1719143, 'dashboard_run_id': 1726970, 'mtr_portfolio_id': 22092677, 'dashboard_result_id': 9898985, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0}"}] SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22091054 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': 2727783, 'mtr_portfolio_id': 22091054, 'created_at': datetime.datetime(2025, 4, 7, 8, 2, 57), 'result': '0.06374295126359755', 'result_long': None, 'result_double': None}] Qualite : 0.06374295126359755 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22091054 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22091054_07-04-2025_08_02_58.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22091054 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_P22091054_07-04-2025_08_02_58.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091058, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091059, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091060, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091061, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091062, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091063, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091064, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091065, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091066, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091067, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091068, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091069, 'pht': 3726}}" where mtr_portfolio_id = 22091054 and dashboard_run_id = 1726970 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`=22091054 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9898982, 0.06374295126359755, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22091054_07-04-2025_08_02_58.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091058, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091059, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091060, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091061, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091062, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091063, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091064, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091065, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091066, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091067, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091068, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091069, '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 = 22091666 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': 2727830, 'mtr_portfolio_id': 22091666, 'created_at': datetime.datetime(2025, 4, 7, 8, 17, 29), 'result': '0.0449185113557412', 'result_long': None, 'result_double': None}] Qualite : 0.0449185113557412 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22091666 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22091666_07-04-2025_08_17_30.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22091666 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_P22091666_07-04-2025_08_17_30.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091670, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091671, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091672, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091673, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091674, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091675, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091676, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091677, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091678, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091679, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091680, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091681, 'pht': 3726}}" where mtr_portfolio_id = 22091666 and dashboard_run_id = 1726970 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`=22091666 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9898983, 0.0449185113557412, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22091666_07-04-2025_08_17_30.pdf', 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22091670, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22091671, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22091672, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22091673, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22091674, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22091675, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22091676, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22091677, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22091678, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22091679, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22091680, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22091681, '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 = 22092221 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': 2727874, 'mtr_portfolio_id': 22092221, 'created_at': datetime.datetime(2025, 4, 7, 8, 31), 'result': '0.030718124051414834', 'result_long': None, 'result_double': None}] Qualite : 0.030718124051414834 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22092221 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22092221_07-04-2025_08_31_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22092221 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_P22092221_07-04-2025_08_31_00.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22092273, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22092274, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22092275, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22092276, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22092277, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22092278, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22092279, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22092280, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22092281, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22092282, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22092283, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22092284, 'pht': 3726}}" where mtr_portfolio_id = 22092221 and dashboard_run_id = 1726970 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`=22092221 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9898984, 0.030718124051414834, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22092221_07-04-2025_08_31_00.pdf', 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22092273, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22092274, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22092275, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22092276, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22092277, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22092278, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22092279, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22092280, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22092281, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22092282, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22092283, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22092284, '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 = 22092677 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22092677 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 ORDER BY created_at desc LIMIT 1 select value from MTRUser.portfolio_carac_ratio where portfolio_id = 22092677 and created_at >= ( SELECT min(created_at) FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22092677 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 )and created_at < ( SELECT addtime(max(created_at),100) FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22092677 AND result is not null and result<>"None" and result=0.0 AND mtd_id=4302 ) order by value desc list_result_datou : [] select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22092677 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22092677_07-04-2025_08_33_03.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22092677 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_P22092677_07-04-2025_08_33_03.pdf'}" where mtr_portfolio_id = 22092677 and dashboard_run_id = 1726970 SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22091054,22091666,22092221,22092677) result : ((1350244682,), (1350244689,), (1350244694,), (1350244744,), (1350244747,), (1350244751,), (1350244755,), (1350244812,), (1350244821,), (1350244868,), (1350244872,), (1350244878,), (1350244896,), (1350244929,), (1350244936,), (1350244940,), (1350244946,), (1350244991,), (1350244994,), (1350244997,), (1350245219,), (1350245226,), (1350245232,), (1350245236,), (1350245308,), (1350245313,), (1350245318,), (1350245382,), (1350245388,), (1350245407,), (1350245449,), (1350245451,), (1350245456,), (1350245461,), (1350245506,), (1350245513,), (1350245516,), (1350245521,), (1350245560,), (1350245565,), (1350245568,), (1350245571,), (1350245588,), (1350245704,), (1350245723,), (1350245726,), (1350245892,), (1350245900,), (1350245909,), (1350245956,), (1350245953,), (1350246013,), (1350246134,), (1350246143,), (1350246151,), (1350246212,), (1350246220,), (1350246232,), (1350246444,), (1350246453,), (1350246511,), (1350246515,), (1350246519,), (1350246521,), (1350246584,), (1350246590,), (1350246594,), (1350246755,), (1350246771,), (1350246783,), (1350246787,), (1350246790,), (1350246952,), (1350246963,), (1350246968,), (1350246977,), (1350246985,), (1350247095,), (1350247103,), (1350247115,), (1350247118,), (1350247212,), (1350247221,), (1350247225,), (1350247232,), (1350247298,), (1350247300,), (1350247303,), (1350247304,), (1350247306,), (1350247341,), (1350247355,), (1350247361,), (1350247427,), (1350247429,), (1350247432,), (1350247434,), (1350247439,), (1350247492,), (1350247486,), (1350247488,), (1350247534,), (1350247543,), (1350247547,), (1350247602,), (1350247606,), (1350247651,), (1350247656,), (1350247798,), (1350247805,), (1350247810,), (1350247844,), (1350247863,), (1350247867,), (1350247872,), (1350247909,), (1350247912,), (1350247914,), (1350247916,), (1350247919,), (1350247922,), (1350247963,), (1350247971,), (1350247984,), (1350248002,), (1350248013,), (1350248018,), (1350248114,), (1350248152,), (1350248155,), (1350248162,), (1350248168,), (1350248202,), (1350248206,), (1350248211,), (1350248286,), (1350248290,), (1350248295,), (1350248302,), (1350248335,), (1350248341,), (1350248347,), (1350248353,), (1350248358,), (1350248402,), (1350248848,), (1350248852,), (1350248857,), (1350248971,), (1350249032,), (1350249090,), (1350249075,), (1350249078,), (1350249081,), (1350249085,), (1350249127,), (1350249130,), (1350249135,), (1350249141,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'07042025': {'nb_upload': 8, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22092677]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] map_info['map_portfolio_photo'] : {22092677: [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075]} final : True mtd_id 4302 list_pids : [1350249141, 1350249135, 1350249130, 1350249127, 1350249085, 1350249081, 1350249078, 1350249075] Looping around the photos to save general results len do output : 1 /22092677Didn'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, '2727917') ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917') ('4302', None, None, None, None, None, None, None, '2727917') ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 9 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', None, '22092677', 'None', None, None, None, None, '2727917'), ('4302', '22092677', '1350249141', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249135', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249130', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249127', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249085', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249081', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249078', None, None, None, None, None, '2727917'), ('4302', '22092677', '1350249075', None, None, None, None, None, '2727917')] time used for this insertion : 0.013637065887451172 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.4390103816986084 time spend to save output : 0.013873577117919922 total time spend for step 5 : 0.4528839588165283 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 (2727917) 2.22user 2.28system 0:09.75elapsed 46%CPU (0avgtext+0avgdata 160840maxresident)k 8560inputs+5576outputs (24major+71991minor)pagefaults 0swaps