python /home/admin/mtr/script_for_cron.py -j datou_current3 -m 20 -a ' -a 4302 -v ' -s datou_current_4302 -M 0 -S 0 -U 95,95,120 import MySQLdb succeeded Import error (python version) ['/Users/moilerat/Documents/Fotonower/install/caffe/distribute/python', '/home/admin/workarea/git/Velours/python/prod', '/home/admin/workarea/install/caffe_cuda8_python3/python', '/home/admin/workarea/install/darknet', '/home/admin/workarea/git/Velours/python', '/home/admin/workarea/install/caffe_frcnn_python3/py-faster-rcnn/caffe-fast-rcnn/python', '/home/admin/mtr/.credentials', '/home/admin/workarea/install/caffe/python', '/home/admin/workarea/install/caffe_frcnn/py-faster-rcnn/tools', '/home/admin/workarea/git/fotonowerpip', '/home/admin/workarea/install/segment-anything', '/home/admin/workarea/git/pyfvs', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/admin/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages'] Namespace(auto=False, cert_args='/home/fotonower/https/cert.pem', contextDataFile='', custom_size=0, database='', datou_id='4302', datou_id_excluded='', fifo=False, host='', is_cpu_mode=False, job='batch_current', json_args='', key_args='/home/fotonower/https/vision.fotonower.com.key', limit=1000, list_photo_ids='', local='', mtr_current_id=0, mtr_portfolio_ids='', nb_thread=1, no_current=False, offset=0, only_client=False, output_file='', password='', port=5100, rand=0, save=2, use_client=False, user_id=440, username='', verbose=True) process id : 314090 load datou : 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 ! Unexpected type seems boolean for variable list_input_json ERROR or WARNING : can't parse json string Expecting value: line 1 column 1 (char 0) Tried to parse : None was removed should we ? donnée sous forme de texte was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? id de la photo (peut être local ou global) was removed should we ? donnée sous forme de texte was removed should we ? donnée sous forme de texte was removed should we ? donnée sous forme de texte was removed should we ? None was removed should we ? donnée sous forme de nombre was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? (photo_id, hashtag_id, score_max) was removed should we ? donnée sous forme de texte was removed should we ? None was removed should we ? donnée sous forme de texte was removed should we ? [ptf_id0,ptf_id1...] was removed should we ? load thcls load pdts Running datou job : batch_current 4302 [] TODO datou_current to load to do maybe to take outside batchDatouExec SELECT * from MTRPhoto.mtr_datou_current where state = 0 AND mtr_portfolio_id is not NULL AND mtd_id = 4302 order by created_at desc LIMIT 1 UPDATE MTRPhoto.mtr_datou_current SET state=1, hostname='marlene' WHERE id in (2786666) updating current state to 1 UPDATE MTRPhoto.mtr_datou_current SET state=1, hostname='marlene' WHERE id in (2786666) SELECT count(*) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634720 AND hide_status = 0 list_input_json: [] Current got : datou_id : 4302, datou_cur_ids : ['2786666'] with mtr_portfolio_ids : ['22634720'] and first list_photo_ids : [] new path : /proc/314090/ Name: python3 Umask: 0002 State: R (running) Tgid: 314090 Ngid: 0 Pid: 314090 PPid: 314089 TracerPid: 0 Uid: 1006 1006 1006 1006 Gid: 1009 1009 1009 1009 FDSize: 64 Groups: 27 1009 1026 NStgid: 314090 NSpid: 314090 NSpgid: 309944 NSsid: 309944 VmPeak: 1107228 kB VmSize: 1107228 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 98880 kB VmRSS: 98880 kB RssAnon: 60196 kB RssFile: 38684 kB RssShmem: 0 kB VmData: 865976 kB VmStk: 132 kB VmExe: 2644 kB VmLib: 130468 kB VmPTE: 608 kB VmSwap: 0 kB HugetlbPages: 0 kB CoreDumping: 0 THP_enabled: 1 Threads: 1 SigQ: 0/63054 SigPnd: 0000000000000000 ShdPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000001001000 SigCgt: 0000000180000002 CapInh: 0000000000000000 CapPrm: 0000000000000000 CapEff: 0000000000000000 CapBnd: 000001ffffffffff CapAmb: 0000000000000000 NoNewPrivs: 0 Seccomp: 0 Seccomp_filters: 0 Speculation_Store_Bypass: thread vulnerable SpeculationIndirectBranch: conditional enabled Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff Cpus_allowed_list: 0-127 Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 Mems_allowed_list: 0 voluntary_ctxt_switches: 54 nonvoluntary_ctxt_switches: 121 {'Name': 'python3', 'Umask': '0002', 'State': 'R (running)', 'Tgid': '314090', 'Ngid': '0', 'Pid': '314090', 'PPid': '314089', 'TracerPid': '0', 'Uid': '1006,1006,1006,1006', 'Gid': '1009,1009,1009,1009', 'FDSize': '64', 'Groups': '27 1009 1026', 'NStgid': '314090', 'NSpid': '314090', 'NSpgid': '309944', 'NSsid': '309944', 'VmPeak': '1107228 kB', 'VmSize': '1107228 kB', 'VmLck': '0 kB', 'VmPin': '0 kB', 'VmHWM': '98880 kB', 'VmRSS': '98880 kB', 'RssAnon': '60196 kB', 'RssFile': '38684 kB', 'RssShmem': '0 kB', 'VmData': '865976 kB', 'VmStk': '132 kB', 'VmExe': '2644 kB', 'VmLib': '130468 kB', 'VmPTE': '608 kB', 'VmSwap': '0 kB', 'HugetlbPages': '0 kB', 'CoreDumping': '0', 'THP_enabled': '1', 'Threads': '1', 'SigQ': '0/63054', 'SigPnd': '0000000000000000', 'ShdPnd': '0000000000000000', 'SigBlk': '0000000000000000', 'SigIgn': '0000000001001000', 'SigCgt': '0000000180000002', 'CapInh': '0000000000000000', 'CapPrm': '0000000000000000', 'CapEff': '0000000000000000', 'CapBnd': '000001ffffffffff', 'CapAmb': '0000000000000000', 'NoNewPrivs': '0', 'Seccomp': '0', 'Seccomp_filters': '0', 'Speculation_Store_Bypass': 'thread vulnerable', 'SpeculationIndirectBranch': 'conditional enabled', 'Cpus_allowed': 'ffffffff,ffffffff,ffffffff,ffffffff', 'Cpus_allowed_list': '0-127', 'Mems_allowed': '00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001', 'Mems_allowed_list': '0', 'voluntary_ctxt_switches': '54', 'nonvoluntary_ctxt_switches': '121'} ('datou_batch_current', '314090', '1107228', '0', '1107228', '865976', '98880', b'', 'marlene', '2786666') insert ignore into MTRAdmin.mem_info (script_name, PID, VMpeak,VMswap,VMsize,VMdata,VMrss,GPU_ram, hostname, mtr_current_id) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) Inside batchDatouExec : verbose : True ##### chargement datou 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 List Step Type Loaded in datou : ventilate_hashtags_in_portfolio, final, velours_tree, send_mail_cod, split_time_score over limit max, limiting to limit_max 200 list_input_json : [] ##### fin chargement datou ##### chargement data ##### Call load_data_input : nb_thread : 1 origin SELECT ph.photo_id, ph.url FROM MTRBack.photos ph WHERE ph.photo_id IN (SELECT mtr_photo_id from MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id in (22634720) and hide_status = 0 ) AND ph.photo_id not in (SELECT mtr_photo_id from MTRPhoto.mtr_datou_result_search where mtr_current_id in (2786666 ) ) ORDER BY ph.photo_id DESC LIMIT 0, 200 We have 1 , {} SELECT mtr_photo_id, mtr_portfolio_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id in (22634720) AND hide_status = 0 ORDER by mtr_photo_id desc LIMIT 0, 200 list_result: [{'photo_id': 1355536798, 'portfolio_id': 22634720}, {'photo_id': 1355536797, 'portfolio_id': 22634720}, {'photo_id': 1355536795, 'portfolio_id': 22634720}, {'photo_id': 1355536700, 'portfolio_id': 22634720}, {'photo_id': 1355536668, 'portfolio_id': 22634720}, {'photo_id': 1355536647, 'portfolio_id': 22634720}, {'photo_id': 1355536641, 'portfolio_id': 22634720}, {'photo_id': 1355536314, 'portfolio_id': 22634720}, {'photo_id': 1355536304, 'portfolio_id': 22634720}, {'photo_id': 1355536271, 'portfolio_id': 22634720}, {'photo_id': 1355536258, 'portfolio_id': 22634720}, {'photo_id': 1355535697, 'portfolio_id': 22634720}, {'photo_id': 1355535520, 'portfolio_id': 22634720}, {'photo_id': 1355535397, 'portfolio_id': 22634720}, {'photo_id': 1355535195, 'portfolio_id': 22634720}, {'photo_id': 1355535136, 'portfolio_id': 22634720}, {'photo_id': 1355535133, 'portfolio_id': 22634720}, {'photo_id': 1355535123, 'portfolio_id': 22634720}] map_portfolio_id_photo_id: {22634720: [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641, 1355536314, 1355536304, 1355536271, 1355536258, 1355535697, 1355535520, 1355535397, 1355535195, 1355535136, 1355535133, 1355535123]} ##### Call download_photos : nb_thread : 1 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos ##### After load_data_input time to download the photos : 0.015545129776000977 #### fin chargement data Blocking on flush ? No conitnuing About to test input to load Calling datou_exec Inside datou_exec : verbose : True number of steps : 5 step1:ventilate_hashtags_in_portfolio Sat May 3 03:20:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22634720) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {} map_subphoto_mainphoto : {} beginning of datou step ventilate_hashtags_in_portfolio : To implement ! To do loadFromThcl(), then load ParamDescType : thcl2725 get_desc_type_from_thcl : type of cat 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 : 22634720 get user id for portfolio 22634720 get sub ptf for main ptf 22634720, type 3726 and hashtags ['Teint_Dans_La_Masse', 'Carton_gris', 'papier', 'environnement', 'metal', 'flou', 'cartonnette', 'kraft', 'mal_croppe', 'plastique', 'Carton_brun', 'autre_refus'] 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`=22634720 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','papier','environnement','metal','flou','cartonnette','kraft','mal_croppe','plastique','Carton_brun','autre_refus')) 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`=22634720 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','papier','environnement','metal','flou','cartonnette','kraft','mal_croppe','plastique','Carton_brun','autre_refus')) AND mptpi.`min_score`=0.5 To do returned map {'Carton_brun': {'main_port_id': 22634720, 'sub_port_id': 22634753, 'hashtag': 'Carton_brun', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060882, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'cartonnette': {'main_port_id': 22634720, 'sub_port_id': 22634754, 'hashtag': 'cartonnette', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060883, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'metal': {'main_port_id': 22634720, 'sub_port_id': 22634755, 'hashtag': 'metal', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060884, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'environnement': {'main_port_id': 22634720, 'sub_port_id': 22634756, 'hashtag': 'environnement', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060885, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'Carton_gris': {'main_port_id': 22634720, 'sub_port_id': 22634757, 'hashtag': 'Carton_gris', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060886, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'Teint_Dans_La_Masse': {'main_port_id': 22634720, 'sub_port_id': 22634758, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060887, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'flou': {'main_port_id': 22634720, 'sub_port_id': 22634759, 'hashtag': 'flou', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060888, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'papier': {'main_port_id': 22634720, 'sub_port_id': 22634760, 'hashtag': 'papier', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060889, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'mal_croppe': {'main_port_id': 22634720, 'sub_port_id': 22634761, 'hashtag': 'mal_croppe', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060890, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'plastique': {'main_port_id': 22634720, 'sub_port_id': 22634762, 'hashtag': 'plastique', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060891, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'autre_refus': {'main_port_id': 22634720, 'sub_port_id': 22634763, 'hashtag': 'autre_refus', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060892, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}, 'kraft': {'main_port_id': 22634720, 'sub_port_id': 22634764, 'hashtag': 'kraft', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060893, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 29), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 28)}} insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634753 , 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=22634720 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 (22634753) result : ((1355536769,), (1355536770,), (1355536789,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634754 , 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=22634720 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 (22634754) result : ((1355536768,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634755 , 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=22634720 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 (22634755) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634756 , 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=22634720 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 (22634756) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634757 , 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=22634720 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 (22634757) result : ((1355536764,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634758 , 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=22634720 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 (22634758) result : ((1355536761,), (1355536786,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634759 , 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=22634720 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 (22634759) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634760 , 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=22634720 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 (22634760) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634761 , 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=22634720 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 (22634761) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634762 , 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=22634720 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 (22634762) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634763 , 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=22634720 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 (22634763) result : ((1355536762,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 22634764 , 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=22634720 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 (22634764) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22634720) result : ((1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) 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 (1355536700) and cspi.crop_hashtag_id = chi.id; 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`=22634720 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','papier','environnement','metal','flou','cartonnette','kraft','mal_croppe','plastique','Carton_brun','autre_refus')) 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`=22634720 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('Teint_Dans_La_Masse','Carton_gris','papier','environnement','metal','flou','cartonnette','kraft','mal_croppe','plastique','Carton_brun','autre_refus')) AND mptpi.`min_score`=0.5 To do returned map {'Carton_brun': {'main_port_id': 22634720, 'sub_port_id': 22634765, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060894, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'cartonnette': {'main_port_id': 22634720, 'sub_port_id': 22634766, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060895, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'metal': {'main_port_id': 22634720, 'sub_port_id': 22634767, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060896, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'environnement': {'main_port_id': 22634720, 'sub_port_id': 22634768, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060897, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'Carton_gris': {'main_port_id': 22634720, 'sub_port_id': 22634769, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060898, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'Teint_Dans_La_Masse': {'main_port_id': 22634720, 'sub_port_id': 22634770, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060899, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'flou': {'main_port_id': 22634720, 'sub_port_id': 22634771, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060900, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'papier': {'main_port_id': 22634720, 'sub_port_id': 22634772, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060901, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'mal_croppe': {'main_port_id': 22634720, 'sub_port_id': 22634773, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060902, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'plastique': {'main_port_id': 22634720, 'sub_port_id': 22634774, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060903, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'autre_refus': {'main_port_id': 22634720, 'sub_port_id': 22634775, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060904, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}, 'kraft': {'main_port_id': 22634720, 'sub_port_id': 22634776, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 15060905, 'last_updated_at': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_desc': datetime.datetime(2025, 5, 3, 3, 19, 30), 'last_updated_at_asc': datetime.datetime(2025, 5, 3, 3, 19, 30)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634765,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634753 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634766,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634754 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634767,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634755 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634768,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634756 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634769,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634757 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634770,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634758 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634771,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634759 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634772,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634760 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634773,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634761 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634774,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634762 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634775,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634763 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 22634776,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 22634764 lien utilise dans velours : https://www.fotonower.com/velours/22634765,22634766,22634767,22634768,22634769,22634770,22634771,22634772,22634773,22634774,22634775,22634776?tags=Carton_brun,cartonnette,metal,environnement,Carton_gris,Teint_Dans_La_Masse,flou,papier,mal_croppe,plastique,autre_refus,kraft After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22634720]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] map_info['map_portfolio_photo'] : {22634720: [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641, 1355536314, 1355536304, 1355536271, 1355536258, 1355535697, 1355535520, 1355535397, 1355535195, 1355535136, 1355535133, 1355535123]} final : False mtd_id 4302 list_pids : [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] Looping around the photos to save general results len do output : 1 /22634720. 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, '2786666') ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666') 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', None, '22634720', "{'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764}", None, None, None, None, '2786666'), ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666')] time used for this insertion : 0.013715982437133789 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.4415440559387207 time spend to save output : 0.014044523239135742 total time spend for step 1 : 0.45558857917785645 step2:final Sat May 3 03:20:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :0, first value : [] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22634720) 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 22634720 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1355535195,1355535136,1355535133,1355535123,1355535697,1355535520,1355535397,1355536314,1355536304,1355536271,1355536258,1355536700,1355536668,1355536647,1355536641,1355536798,1355536797,1355536795); insert ignore into MTRUser.portfolio_carac_ratio (portfolio_id, hashtag_type, hashtag_id, value) values (%s,%s,%s,%s) on DUPLICATE KEY UPDATE value=VALUES(value) After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22634720]) Inside saveOutput : final : False verbose : True original output for save of step final : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} new output for save of step final : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] map_info['map_portfolio_photo'] : {22634720: [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641, 1355536314, 1355536304, 1355536271, 1355536258, 1355535697, 1355535520, 1355535397, 1355535195, 1355535136, 1355535133, 1355535123]} final : False mtd_id 4302 list_pids : [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] Looping around the photos to save general results len do output : 7 /1355536798.Didn't retrieve data . /1355536797.Didn't retrieve data . /1355536795.Didn't retrieve data . /1355536700.Didn't retrieve data . /1355536668.Didn't retrieve data . /1355536647.Didn't retrieve data . /1355536641.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, '2786666') ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 21 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', '22634720', '1355536798', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536797', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536795', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536700', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536668', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536647', '0.03181188557997519', None, None, None, None, '2786666'), ('4302', '22634720', '1355536641', '0.03181188557997519', None, None, None, None, '2786666')] time used for this insertion : 0.013712167739868164 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.06388306617736816 time spend to save output : 0.014217376708984375 total time spend for step 2 : 0.07810044288635254 step3:velours_tree Sat May 3 03:20:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : {22634720: [{'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764}]} input_args_next_step : {22634720: ()} output_args : {22634720: [{'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764}]} args : 22634720 depend.output_id : 0 VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :1, first value : ({'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22634720) 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([22634720]) 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.7580223083496094 time spend to save output : 6.985664367675781e-05 total time spend for step 3 : 0.7580921649932861 step4:send_mail_cod Sat May 3 03:21:00 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 : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} input_args_next_step : {1355536798: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536798 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536797 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536795 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536700 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536668 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536647 depend.output_id : 0 input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ()} output_args : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',)} args : 1355536641 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 : {22634720: [{'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764}]} input_args_next_step : {1355536798: ('0.03181188557997519',), 1355536797: ('0.03181188557997519',), 1355536795: ('0.03181188557997519',), 1355536700: ('0.03181188557997519',), 1355536668: ('0.03181188557997519',), 1355536647: ('0.03181188557997519',), 1355536641: ('0.03181188557997519',), 22634720: ()} output_args : {22634720: [{'Carton_brun': 22634753, 'cartonnette': 22634754, 'metal': 22634755, 'environnement': 22634756, 'Carton_gris': 22634757, 'Teint_Dans_La_Masse': 22634758, 'flou': 22634759, 'papier': 22634760, 'mal_croppe': 22634761, 'plastique': 22634762, 'autre_refus': 22634763, 'kraft': 22634764}]} args : 22634720 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 :8, first value : ('0.03181188557997519',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22634720) 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 (1355536798,1355536797,1355536795,1355536700,1355536668,1355536647,1355536641) Found this number of photos: 7 ##### Call download_photos : nb_thread : 5 begin to download photo : 1355536641 begin to download photo : 1355536668 begin to download photo : 1355536795 begin to download photo : 1355536798 download finish for photo 1355536641 begin to download photo : 1355536647 download finish for photo 1355536668 begin to download photo : 1355536700 download finish for photo 1355536795 begin to download photo : 1355536797 download finish for photo 1355536798 download finish for photo 1355536700 download finish for photo 1355536647 download finish for photo 1355536797 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos length of list_filenames : 7 ; length of list_pids : 7 ; length of list_args : 7 results_Auto_P22634720_03-05-2025_03_21_01.pdf 22634754 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=22634754 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1355536768: '1746235151_3232053_1355536304_67705242f0281768cad97f67055cc1ac_rle_crop_3781317159_0.png'} change filename to text .imagette226347541746235261/ imagette226347541746235261/1746235151_3232053_1355536304_67705242f0281768cad97f67055cc1ac_rle_crop_3781317159_0.png.png imagette226347551746235261/ imagette226347591746235261/ imagette226347611746235261/ imagette226347621746235261/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/00205c8a75ad02eeab9686e832fe9f27_23091227.png imagette226347541746235261 22634755 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=22634755 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette226347551746235261 22634759 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=22634759 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette226347591746235261 22634761 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=22634761 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette226347611746235261 22634762 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=22634762 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette226347621746235261 22634763 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=22634763 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1355536762: '1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317220_0.png'} change filename to text .imagette226347631746235261/ imagette226347631746235261/1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317220_0.png.png imagette226347641746235261/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/72e392be671ccc168ccffb1745d22aba_46656088.png imagette226347631746235261 22634764 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=22634764 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette226347641746235261 22634753 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=22634753 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1355536769: '1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317218_0.png', 1355536770: '1746235151_3232053_1355536258_a8d8738adc631f719cf6085f4543da1b_rle_crop_3781317234_0.png', 1355536789: '1746235165_2496483_1355535520_f4a9398f53c99440724231eff95493c0_rle_crop_3781317293_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/8b39f89078a78a2cbef2345b2424b0c6_40988773.png change filename to text .wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/c509a1f75e05965d91acb5929d04643a_48142379.png change filename to text .imagette226347531746235261/ imagette226347531746235261/1746235165_2496483_1355535520_f4a9398f53c99440724231eff95493c0_rle_crop_3781317293_0.png.png imagette226347531746235261/1746235151_3232053_1355536258_a8d8738adc631f719cf6085f4543da1b_rle_crop_3781317234_0.png.png imagette226347531746235261/1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317218_0.png.png wget -O 3.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/eb5c734e674471579b9a362d56e00b99_87385052.png imagette226347531746235261 22634757 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=22634757 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1355536764: '1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317216_0.png'} change filename to text .imagette226347571746235261/ imagette226347571746235261/1746235151_3232053_1355536271_5a0e69917d2e7e06a1c5c44464f735ac_rle_crop_3781317216_0.png.png wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/a4d39f708e1936dd4e81815b68e288bf_17023595.png imagette226347571746235261 22634758 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=22634758 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1355536761: '1746235151_3232053_1355536258_a8d8738adc631f719cf6085f4543da1b_rle_crop_3781317236_0.png', 1355536786: '1746235165_2496483_1355535520_f4a9398f53c99440724231eff95493c0_rle_crop_3781317292_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/648660d3a9ebf3509ab665d6ae9a5783_97196925.png change filename to text .imagette226347581746235261/ imagette226347581746235261/1746235165_2496483_1355535520_f4a9398f53c99440724231eff95493c0_rle_crop_3781317292_0.png.png imagette226347581746235261/1746235151_3232053_1355536258_a8d8738adc631f719cf6085f4543da1b_rle_crop_3781317236_0.png.png wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/81f5ec8a4c29c2864c0273bfaf5b352e_32505219.png imagette226347581746235261 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=22634720 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/22634765,22634766,22634767,22634768,22634769,22634770,22634771,22634772,22634773,22634774,22634775,22634776?tags=Carton_brun,cartonnette,metal,environnement,Carton_gris,Teint_Dans_La_Masse,flou,papier,mal_croppe,plastique,autre_refus,kraft your option no_mail is active, we will not send the real mail to your client args[1355536798] : ('0.03181188557997519',) no score found for photo 1355536798 We are sending mail with results at report@fotonower.com args[1355536797] : ('0.03181188557997519',) no score found for photo 1355536797 We are sending mail with results at report@fotonower.com args[1355536795] : ('0.03181188557997519',) no score found for photo 1355536795 We are sending mail with results at report@fotonower.com args[1355536700] : ('0.03181188557997519',) no score found for photo 1355536700 We are sending mail with results at report@fotonower.com args[1355536668] : ('0.03181188557997519',) no score found for photo 1355536668 We are sending mail with results at report@fotonower.com args[1355536647] : ('0.03181188557997519',) no score found for photo 1355536647 We are sending mail with results at report@fotonower.com args[1355536641] : ('0.03181188557997519',) no score found for photo 1355536641 We are sending mail with results at report@fotonower.com refus_total : 0.03181188557997519 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=22634720 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_P22634720_03-05-2025_03_21_01.pdf results_Auto_P22634720_03-05-2025_03_21_01.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634720_03-05-2025_03_21_01.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','22634720','results_Auto_P22634720_03-05-2025_03_21_01.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634720_03-05-2025_03_21_01.pdf','pdf','','0.09','0.03181188557997519') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22634720]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] map_info['map_portfolio_photo'] : {22634720: [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641, 1355536314, 1355536304, 1355536271, 1355536258, 1355535697, 1355535520, 1355535397, 1355535195, 1355535136, 1355535133, 1355535123]} final : False mtd_id 4302 list_pids : [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] 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, '2786666') ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 7 insert ignore into MTRPhoto.mtr_datou_result (mtd_id, mtr_portfolio_id,mtr_photo_id,result,result_long,result_double,hashtag_id,proba, mtr_current_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s) on duplicate key update mtr_portfolio_id = mtr_portfolio_id list_values : [('4302', '22634720', '1355536798', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666')] time used for this insertion : 0.013527393341064453 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.682471513748169 time spend to save output : 0.01392221450805664 total time spend for step 4 : 1.6963937282562256 step5:split_time_score Sat May 3 03:21: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 : ['22634720'] 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 : [('22634720',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (22634720) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1355536798: {'path': 'temp/1746235260_314090_1355536798_ae9c0b30199cd6b093ba9d6fd1481ac0.jpg', 'extension': 'jpg'}, 1355536668: {'path': 'temp/1746235260_314090_1355536668_3f488767010c98093c60e6c8a767a47f.jpg', 'extension': 'jpg'}, 1355536700: {'path': 'temp/1746235260_314090_1355536700_da5ba668fa49549c58dc4ec05c02c41c.jpg', 'extension': 'jpg'}, 1355536641: {'path': 'temp/1746235260_314090_1355536641_66134b66fc198512304312389dcb9ef6.jpg', 'extension': 'jpg'}, 1355536647: {'path': 'temp/1746235260_314090_1355536647_a2603845a674b7ba62013fcd495e51a7.jpg', 'extension': 'jpg'}, 1355536795: {'path': 'temp/1746235260_314090_1355536795_94ae562322a9b9fb20525301e6f0212e.jpg', 'extension': 'jpg'}, 1355536797: {'path': 'temp/1746235260_314090_1355536797_d19421c1db7e4a6845d11bd7c7458445.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 = 22634720; (('arc_en_ciel_jrm_live',),) TODO : Insert select and so on Begin split_port_in_batch_balle thcls : [{'id': 861, 'mtr_user_id': 31, 'name': 'Rungis_class_dechets_1212', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Rungis_Aluminium,Rungis_Carton,Rungis_Papier,Rungis_Plastique_clair,Rungis_Plastique_dur,Rungis_Plastique_fonce,Rungis_Tapis_vide,Rungis_Tetrapak', 'svm_portfolios_learning': '1160730,571842,571844,571839,571933,571840,571841,572307', 'photo_hashtag_type': 999, 'photo_desc_type': 3963, 'type_classification': 'caffe', 'hashtag_id_list': '2107751280,2107750907,2107750908,2107750909,2107750910,2107750911,2107750912,2107750913'}] thcls : [{'id': 758, 'mtr_user_id': 31, 'name': 'Rungis_amount_dechets_fall_2018_v2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': '05102018_Papier_non_papier_dense,05102018_Papier_non_papier_peu_dense,05102018_Papier_non_papier_presque_vide,05102018_Papier_non_papier_tres_dense,05102018_Papier_non_papier_tres_peu_dense', 'svm_portfolios_learning': '1108385,1108386,1108388,1108384,1108387', 'photo_hashtag_type': 856, 'photo_desc_type': 3853, 'type_classification': 'caffe', 'hashtag_id_list': '2107751013,2107751014,2107751015,2107751016,2107751017'}] select SUBSTRING(ph.text,16,2) as h, count(*) from MTRUser.mtr_portfolio_photos mpp inner join MTRBack.photos ph on mpp.mtr_photo_id = ph.photo_id where mpp.mtr_portfolio_id = 22634720 group by h (('03', 18),) 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=22634720 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 (22634720) 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 (22634720) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 03052025 22634720 Nombre de photos uploadées : 18 / 23040 (0%) 03052025 22634720 Nombre de photos taguées (types de déchets): 0 / 18 (0%) 03052025 22634720 Nombre de photos taguées (volume) : 0 / 18 (0%) [{'photo_id': 1355535195, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/6f3820a815feaee52d2c28c55ecd37a5.jpg', 'username': None, 'uploaded_at': 1746234967, 'text': 'image_03052025_03_15_03_10158.jpg'}, {'photo_id': 1355535136, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/0b505feedbc0e12d84992fb093647d2b.jpg', 'username': None, 'uploaded_at': 1746234967, 'text': 'image_03052025_03_15_13_10140.jpg'}, {'photo_id': 1355535133, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/37b02b1f85825ef5ae9b9b975d0e640c.jpg', 'username': None, 'uploaded_at': 1746234967, 'text': 'image_03052025_03_15_34_10135.jpg'}, {'photo_id': 1355535123, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/5/3/282c2b3f3b6b065a60d551c0a00abaff.jpg', 'username': None, 'uploaded_at': 1746234967, 'text': 'image_03052025_03_15_44_10136.jpg'}] 0 [] elapsed_time : load_data_split_time_score 4.0531158447265625e-06 elapsed_time : order_list_meta_photo_and_scores 1.1444091796875e-05 ?????????????????? elapsed_time : fill_and_build_computed_from_old_data 0.001310110092163086 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 218, 22634720, '2025-05-03' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1769704,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.02339649200439453 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= 1769704 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1769704, 'dashboard_run_id': 1777611, 'mtr_portfolio_id': 22632867, 'dashboard_result_id': 10264261, '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_P22632867_03-05-2025_02_47_29.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22632907, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22632908, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22632909, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22632910, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22632911, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22632912, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22632913, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22632914, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22632915, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22632916, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22632917, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22632918, 'pht': 3726}}"}, {'dashboat_entry_day': 1769704, 'dashboard_run_id': 1777611, 'mtr_portfolio_id': 22633414, 'dashboard_result_id': 10264262, '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_P22633414_03-05-2025_03_05_01.pdf', 'papier': {'hashtag': 'papier', 'sub_port_id': 22633445, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22633446, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22633447, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22633448, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22633449, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22633450, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22633451, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22633452, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22633453, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22633454, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22633455, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22633456, 'pht': 3726}}"}, {'dashboat_entry_day': 1769704, 'dashboard_run_id': 1777611, 'mtr_portfolio_id': 22634144, 'dashboard_result_id': 10264263, '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_P22634144_03-05-2025_03_19_02.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634226, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634227, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634228, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634229, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634230, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634231, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634232, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634233, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634234, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634235, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634236, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634237, 'pht': 3726}}"}, {'dashboat_entry_day': 1769704, 'dashboard_run_id': 1777611, 'mtr_portfolio_id': 22634720, 'dashboard_result_id': 10264264, '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_P22634720_03-05-2025_03_19_31.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634753, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634754, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634755, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634756, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634757, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634760, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634761, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634762, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634763, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634764, 'pht': 3726}}"}] SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 22632867 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': 2786506, 'mtr_portfolio_id': 22632867, 'created_at': datetime.datetime(2025, 5, 3, 2, 47, 28), 'result': '0.055273554809005566', 'result_long': None, 'result_double': None}] Qualite : 0.055273554809005566 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22632867 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22632867_03-05-2025_02_47_29.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22632867 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_P22632867_03-05-2025_02_47_29.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22632907, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22632908, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22632909, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22632910, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22632911, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22632912, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22632913, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22632914, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22632915, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22632916, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22632917, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22632918, 'pht': 3726}}" where mtr_portfolio_id = 22632867 and dashboard_run_id = 1777611 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`=22632867 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10264261, 0.055273554809005566, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22632867_03-05-2025_02_47_29.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22632907, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22632908, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22632909, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22632910, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22632911, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22632912, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22632913, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22632914, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22632915, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22632916, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22632917, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22632918, '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 = 22633414 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': 2786538, 'mtr_portfolio_id': 22633414, 'created_at': datetime.datetime(2025, 5, 3, 3, 4, 59), 'result': '0.047045193906858414', 'result_long': None, 'result_double': None}] Qualite : 0.047045193906858414 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22633414 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22633414_03-05-2025_03_05_01.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22633414 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_P22633414_03-05-2025_03_05_01.pdf', 'papier': {'hashtag': 'papier', 'sub_port_id': 22633445, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22633446, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22633447, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22633448, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22633449, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22633450, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22633451, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22633452, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22633453, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22633454, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22633455, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22633456, 'pht': 3726}}" where mtr_portfolio_id = 22633414 and dashboard_run_id = 1777611 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`=22633414 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10264262, 0.047045193906858414, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22633414_03-05-2025_03_05_01.pdf', 'papier': {'hashtag': 'papier', 'sub_port_id': 22633445, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22633446, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22633447, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22633448, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22633449, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22633450, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22633451, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22633452, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22633453, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22633454, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22633455, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22633456, '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 = 22634144 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': 2786629, 'mtr_portfolio_id': 22634144, 'created_at': datetime.datetime(2025, 5, 3, 3, 19, 1), 'result': '0.05488809553215058', 'result_long': None, 'result_double': None}] Qualite : 0.05488809553215058 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22634144 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634144_03-05-2025_03_19_02.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22634144 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_P22634144_03-05-2025_03_19_02.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634226, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634227, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634228, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634229, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634230, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634231, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634232, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634233, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634234, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634235, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634236, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634237, 'pht': 3726}}" where mtr_portfolio_id = 22634144 and dashboard_run_id = 1777611 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`=22634144 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10264263, 0.05488809553215058, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634144_03-05-2025_03_19_02.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634226, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634227, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634228, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634229, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634230, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634231, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634232, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634233, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634234, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634235, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634236, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634237, '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 = 22634720 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': 2786666, 'mtr_portfolio_id': 22634720, 'created_at': datetime.datetime(2025, 5, 3, 3, 20, 59), 'result': '0.03181188557997519', 'result_long': None, 'result_double': None}] Qualite : 0.03181188557997519 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 22634720 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634720_03-05-2025_03_21_01.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 22634720 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_P22634720_03-05-2025_03_21_01.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634753, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634754, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634755, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634756, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634757, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634760, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634761, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634762, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634763, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634764, 'pht': 3726}}" where mtr_portfolio_id = 22634720 and dashboard_run_id = 1777611 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`=22634720 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (10264264, 0.03181188557997519, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P22634720_03-05-2025_03_21_01.pdf', 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 22634753, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 22634754, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 22634755, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 22634756, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 22634757, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 22634758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 22634759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 22634760, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 22634761, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 22634762, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 22634763, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 22634764, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (22632867,22633414,22634144,22634720) result : ((1355522448,), (1355522759,), (1355522786,), (1355522800,), (1355522833,), (1355522834,), (1355522837,), (1355522839,), (1355522846,), (1355522862,), (1355522901,), (1355522903,), (1355522906,), (1355523050,), (1355523051,), (1355523345,), (1355523373,), (1355523415,), (1355524068,), (1355524116,), (1355524161,), (1355524215,), (1355524966,), (1355524990,), (1355525015,), (1355525211,), (1355525759,), (1355525821,), (1355525878,), (1355525907,), (1355526271,), (1355526292,), (1355526302,), (1355526392,), (1355526416,), (1355526440,), (1355526450,), (1355526489,), (1355526514,), (1355526547,), (1355526653,), (1355527251,), (1355527282,), (1355527304,), (1355527331,), (1355527340,), (1355527356,), (1355527488,), (1355527516,), (1355527678,), (1355527674,), (1355527676,), (1355527922,), (1355527981,), (1355528031,), (1355528084,), (1355528568,), (1355528573,), (1355528576,), (1355528580,), (1355528583,), (1355528648,), (1355528649,), (1355528650,), (1355528651,), (1355528688,), (1355528690,), (1355528691,), (1355528692,), (1355528747,), (1355528749,), (1355528750,), (1355528788,), (1355528789,), (1355528790,), (1355528792,), (1355528794,), (1355528798,), (1355528822,), (1355528824,), (1355528826,), (1355528828,), (1355528831,), (1355528850,), (1355528866,), (1355528869,), (1355528885,), (1355528892,), (1355528896,), (1355529168,), (1355529177,), (1355529179,), (1355529236,), (1355529239,), (1355529240,), (1355529247,), (1355529251,), (1355529255,), (1355529373,), (1355529374,), (1355529375,), (1355529377,), (1355529429,), (1355529433,), (1355529434,), (1355530105,), (1355530110,), (1355530116,), (1355530122,), (1355530133,), (1355530215,), (1355530242,), (1355530275,), (1355530294,), (1355530506,), (1355530431,), (1355530491,), (1355530503,), (1355530614,), (1355530637,), (1355530666,), (1355530831,), (1355530914,), (1355530954,), (1355530998,), (1355531344,), (1355531373,), (1355531902,), (1355532398,), (1355532424,), (1355532623,), (1355532649,), (1355533263,), (1355533276,), (1355533279,), (1355533404,), (1355533416,), (1355533442,), (1355533470,), (1355533604,), (1355533606,), (1355533608,), (1355533652,), (1355533756,), (1355533758,), (1355533760,), (1355533762,), (1355534368,), (1355534380,), (1355534698,), (1355534700,), (1355534735,), (1355535279,), (1355535123,), (1355535133,), (1355535136,), (1355535195,), (1355535397,), (1355535520,), (1355535697,), (1355536258,), (1355536271,), (1355536304,), (1355536314,), (1355536641,), (1355536647,), (1355536668,), (1355536700,), (1355536795,), (1355536797,), (1355536798,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'03052025': {'nb_upload': 18, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([22634720]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] map_info['map_portfolio_photo'] : {22634720: [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641, 1355536314, 1355536304, 1355536271, 1355536258, 1355535697, 1355535520, 1355535397, 1355535195, 1355535136, 1355535133, 1355535123]} final : True mtd_id 4302 list_pids : [1355536798, 1355536797, 1355536795, 1355536700, 1355536668, 1355536647, 1355536641] Looping around the photos to save general results len do output : 1 /22634720Didn'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, '2786666') ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666') ('4302', None, None, None, None, None, None, None, '2786666') ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666') 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', None, '22634720', 'None', None, None, None, None, '2786666'), ('4302', '22634720', '1355536798', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536797', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536795', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536700', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536668', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536647', None, None, None, None, None, '2786666'), ('4302', '22634720', '1355536641', None, None, None, None, None, '2786666')] time used for this insertion : 0.014657258987426758 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.37392139434814453 time spend to save output : 0.01500558853149414 total time spend for step 5 : 0.38892698287963867 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 (2786666) 2.26user 2.57system 0:07.88elapsed 61%CPU (0avgtext+0avgdata 159216maxresident)k 92264inputs+4512outputs (394major+74697minor)pagefaults 0swaps