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 : 2176580 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 (3278008) updating current state to 1 UPDATE MTRPhoto.mtr_datou_current SET state=1, hostname='marlene' WHERE id in (3278008) SELECT count(*) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903073 AND hide_status = 0 list_input_json: [] Current got : datou_id : 4302, datou_cur_ids : ['3278008'] with mtr_portfolio_ids : ['24903073'] and first list_photo_ids : [] new path : /proc/2176580/ Name: python3 Umask: 0002 State: R (running) Tgid: 2176580 Ngid: 0 Pid: 2176580 PPid: 2176579 TracerPid: 0 Uid: 1006 1006 1006 1006 Gid: 1009 1009 1009 1009 FDSize: 64 Groups: 27 1009 1026 NStgid: 2176580 NSpid: 2176580 NSpgid: 2172316 NSsid: 2172316 VmPeak: 1106868 kB VmSize: 1106868 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 100480 kB VmRSS: 100480 kB RssAnon: 59816 kB RssFile: 40664 kB RssShmem: 0 kB VmData: 865620 kB VmStk: 132 kB VmExe: 2644 kB VmLib: 130468 kB VmPTE: 592 kB VmSwap: 0 kB HugetlbPages: 0 kB CoreDumping: 0 THP_enabled: 1 Threads: 1 SigQ: 6/63019 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: 43 nonvoluntary_ctxt_switches: 87 {'Name': 'python3', 'Umask': '0002', 'State': 'R (running)', 'Tgid': '2176580', 'Ngid': '0', 'Pid': '2176580', 'PPid': '2176579', 'TracerPid': '0', 'Uid': '1006,1006,1006,1006', 'Gid': '1009,1009,1009,1009', 'FDSize': '64', 'Groups': '27 1009 1026', 'NStgid': '2176580', 'NSpid': '2176580', 'NSpgid': '2172316', 'NSsid': '2172316', 'VmPeak': '1106868 kB', 'VmSize': '1106868 kB', 'VmLck': '0 kB', 'VmPin': '0 kB', 'VmHWM': '100480 kB', 'VmRSS': '100480 kB', 'RssAnon': '59816 kB', 'RssFile': '40664 kB', 'RssShmem': '0 kB', 'VmData': '865620 kB', 'VmStk': '132 kB', 'VmExe': '2644 kB', 'VmLib': '130468 kB', 'VmPTE': '592 kB', 'VmSwap': '0 kB', 'HugetlbPages': '0 kB', 'CoreDumping': '0', 'THP_enabled': '1', 'Threads': '1', 'SigQ': '6/63019', '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': '43', 'nonvoluntary_ctxt_switches': '87'} ('datou_batch_current', '2176580', '1106868', '0', '1106868', '865620', '100480', b'', 'marlene', '3278008') 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 (24903073) 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 (3278008 ) ) 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 (24903073) AND hide_status = 0 ORDER by mtr_photo_id desc LIMIT 0, 200 list_result: [{'photo_id': 1372080071, 'portfolio_id': 24903073}, {'photo_id': 1372080069, 'portfolio_id': 24903073}, {'photo_id': 1372080067, 'portfolio_id': 24903073}, {'photo_id': 1372080065, 'portfolio_id': 24903073}, {'photo_id': 1372080062, 'portfolio_id': 24903073}, {'photo_id': 1372080059, 'portfolio_id': 24903073}, {'photo_id': 1372079686, 'portfolio_id': 24903073}, {'photo_id': 1372079638, 'portfolio_id': 24903073}, {'photo_id': 1372079593, 'portfolio_id': 24903073}, {'photo_id': 1372079566, 'portfolio_id': 24903073}, {'photo_id': 1372079540, 'portfolio_id': 24903073}, {'photo_id': 1372079511, 'portfolio_id': 24903073}, {'photo_id': 1372079158, 'portfolio_id': 24903073}, {'photo_id': 1372079113, 'portfolio_id': 24903073}, {'photo_id': 1372079068, 'portfolio_id': 24903073}, {'photo_id': 1372079025, 'portfolio_id': 24903073}, {'photo_id': 1372078980, 'portfolio_id': 24903073}, {'photo_id': 1372078934, 'portfolio_id': 24903073}, {'photo_id': 1372078801, 'portfolio_id': 24903073}, {'photo_id': 1372078800, 'portfolio_id': 24903073}, {'photo_id': 1372078799, 'portfolio_id': 24903073}, {'photo_id': 1372078797, 'portfolio_id': 24903073}, {'photo_id': 1372078796, 'portfolio_id': 24903073}, {'photo_id': 1372078794, 'portfolio_id': 24903073}, {'photo_id': 1372078784, 'portfolio_id': 24903073}, {'photo_id': 1372078782, 'portfolio_id': 24903073}, {'photo_id': 1372078779, 'portfolio_id': 24903073}, {'photo_id': 1372078776, 'portfolio_id': 24903073}, {'photo_id': 1372078774, 'portfolio_id': 24903073}, {'photo_id': 1372078771, 'portfolio_id': 24903073}, {'photo_id': 1372078761, 'portfolio_id': 24903073}, {'photo_id': 1372078760, 'portfolio_id': 24903073}, {'photo_id': 1372078759, 'portfolio_id': 24903073}, {'photo_id': 1372078757, 'portfolio_id': 24903073}, {'photo_id': 1372078753, 'portfolio_id': 24903073}, {'photo_id': 1372078750, 'portfolio_id': 24903073}, {'photo_id': 1372078738, 'portfolio_id': 24903073}, {'photo_id': 1372078737, 'portfolio_id': 24903073}, {'photo_id': 1372078736, 'portfolio_id': 24903073}, {'photo_id': 1372078735, 'portfolio_id': 24903073}, {'photo_id': 1372078734, 'portfolio_id': 24903073}, {'photo_id': 1372078733, 'portfolio_id': 24903073}, {'photo_id': 1372078721, 'portfolio_id': 24903073}, {'photo_id': 1372078720, 'portfolio_id': 24903073}, {'photo_id': 1372078719, 'portfolio_id': 24903073}, {'photo_id': 1372078718, 'portfolio_id': 24903073}, {'photo_id': 1372078716, 'portfolio_id': 24903073}, {'photo_id': 1372078715, 'portfolio_id': 24903073}, {'photo_id': 1372078704, 'portfolio_id': 24903073}, {'photo_id': 1372078703, 'portfolio_id': 24903073}, {'photo_id': 1372078702, 'portfolio_id': 24903073}, {'photo_id': 1372078701, 'portfolio_id': 24903073}, {'photo_id': 1372078700, 'portfolio_id': 24903073}, {'photo_id': 1372078699, 'portfolio_id': 24903073}, {'photo_id': 1372078671, 'portfolio_id': 24903073}, {'photo_id': 1372078669, 'portfolio_id': 24903073}, {'photo_id': 1372078668, 'portfolio_id': 24903073}, {'photo_id': 1372078667, 'portfolio_id': 24903073}, {'photo_id': 1372078666, 'portfolio_id': 24903073}, {'photo_id': 1372078664, 'portfolio_id': 24903073}, {'photo_id': 1372078654, 'portfolio_id': 24903073}, {'photo_id': 1372078652, 'portfolio_id': 24903073}, {'photo_id': 1372078650, 'portfolio_id': 24903073}, {'photo_id': 1372078648, 'portfolio_id': 24903073}, {'photo_id': 1372078646, 'portfolio_id': 24903073}, {'photo_id': 1372078644, 'portfolio_id': 24903073}, {'photo_id': 1372078634, 'portfolio_id': 24903073}, {'photo_id': 1372078633, 'portfolio_id': 24903073}, {'photo_id': 1372078632, 'portfolio_id': 24903073}, {'photo_id': 1372078631, 'portfolio_id': 24903073}, {'photo_id': 1372078630, 'portfolio_id': 24903073}, {'photo_id': 1372078629, 'portfolio_id': 24903073}, {'photo_id': 1372078623, 'portfolio_id': 24903073}, {'photo_id': 1372078621, 'portfolio_id': 24903073}, {'photo_id': 1372078620, 'portfolio_id': 24903073}, {'photo_id': 1372078618, 'portfolio_id': 24903073}, {'photo_id': 1372078617, 'portfolio_id': 24903073}, {'photo_id': 1372078615, 'portfolio_id': 24903073}, {'photo_id': 1372078608, 'portfolio_id': 24903073}, {'photo_id': 1372078607, 'portfolio_id': 24903073}, {'photo_id': 1372078606, 'portfolio_id': 24903073}, {'photo_id': 1372078605, 'portfolio_id': 24903073}, {'photo_id': 1372078603, 'portfolio_id': 24903073}, {'photo_id': 1372078599, 'portfolio_id': 24903073}] map_portfolio_id_photo_id: {24903073: [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059, 1372079686, 1372079638, 1372079593, 1372079566, 1372079540, 1372079511, 1372079158, 1372079113, 1372079068, 1372079025, 1372078980, 1372078934, 1372078801, 1372078800, 1372078799, 1372078797, 1372078796, 1372078794, 1372078784, 1372078782, 1372078779, 1372078776, 1372078774, 1372078771, 1372078761, 1372078760, 1372078759, 1372078757, 1372078753, 1372078750, 1372078738, 1372078737, 1372078736, 1372078735, 1372078734, 1372078733, 1372078721, 1372078720, 1372078719, 1372078718, 1372078716, 1372078715, 1372078704, 1372078703, 1372078702, 1372078701, 1372078700, 1372078699, 1372078671, 1372078669, 1372078668, 1372078667, 1372078666, 1372078664, 1372078654, 1372078652, 1372078650, 1372078648, 1372078646, 1372078644, 1372078634, 1372078633, 1372078632, 1372078631, 1372078630, 1372078629, 1372078623, 1372078621, 1372078620, 1372078618, 1372078617, 1372078615, 1372078608, 1372078607, 1372078606, 1372078605, 1372078603, 1372078599]} ##### 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.01545572280883789 #### 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 Mon Jul 14 06:00:57 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 (24903073) 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 : 24903073 get user id for portfolio 24903073 get sub ptf for main ptf 24903073, type 3726 and hashtags ['cartonnette', 'metal', 'papier', 'plastique', 'kraft', 'Carton_gris', 'Carton_brun', 'autre_refus', 'mal_croppe', 'Teint_Dans_La_Masse', 'flou', 'environnement'] 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`=24903073 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('cartonnette','metal','papier','plastique','kraft','Carton_gris','Carton_brun','autre_refus','mal_croppe','Teint_Dans_La_Masse','flou','environnement')) 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`=24903073 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('cartonnette','metal','papier','plastique','kraft','Carton_gris','Carton_brun','autre_refus','mal_croppe','Teint_Dans_La_Masse','flou','environnement')) AND mptpi.`min_score`=0.5 To do returned map {'plastique': {'main_port_id': 24903073, 'sub_port_id': 24903099, 'hashtag': 'plastique', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766711, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'kraft': {'main_port_id': 24903073, 'sub_port_id': 24903100, 'hashtag': 'kraft', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766712, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'mal_croppe': {'main_port_id': 24903073, 'sub_port_id': 24903101, 'hashtag': 'mal_croppe', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766713, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'Carton_brun': {'main_port_id': 24903073, 'sub_port_id': 24903102, 'hashtag': 'Carton_brun', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766714, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'metal': {'main_port_id': 24903073, 'sub_port_id': 24903103, 'hashtag': 'metal', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766715, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'cartonnette': {'main_port_id': 24903073, 'sub_port_id': 24903104, 'hashtag': 'cartonnette', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766716, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'flou': {'main_port_id': 24903073, 'sub_port_id': 24903105, 'hashtag': 'flou', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766717, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'autre_refus': {'main_port_id': 24903073, 'sub_port_id': 24903106, 'hashtag': 'autre_refus', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766718, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'environnement': {'main_port_id': 24903073, 'sub_port_id': 24903107, 'hashtag': 'environnement', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766719, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'Carton_gris': {'main_port_id': 24903073, 'sub_port_id': 24903108, 'hashtag': 'Carton_gris', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766720, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'papier': {'main_port_id': 24903073, 'sub_port_id': 24903109, 'hashtag': 'papier', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766721, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}, 'Teint_Dans_La_Masse': {'main_port_id': 24903073, 'sub_port_id': 24903110, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766722, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 58, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 56)}} insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 24903099 , 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=24903073 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 (24903099) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903100 , 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=24903073 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 (24903100) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903101 , 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=24903073 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 (24903101) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903102 , 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=24903073 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 (24903102) result : ((1372078713,), (1372078714,), (1372078725,), (1372078762,), (1372078763,), (1372078804,), (1372079467,), (1372079469,), (1372079471,), (1372079815,), (1372080057,), (1372080058,), (1372080075,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903103 , 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=24903073 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 (24903103) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903104 , 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=24903073 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 (24903104) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903105 , 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=24903073 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 (24903105) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903106 , 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=24903073 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 (24903106) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903107 , 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=24903073 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 (24903107) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903108 , 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=24903073 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 (24903108) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903109 , 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=24903073 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 (24903109) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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 24903110 , 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=24903073 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 (24903110) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (24903073) result : ((1372078599,), (1372078603,), (1372078605,), (1372078606,), (1372078607,), (1372078608,), (1372078615,), (1372078617,), (1372078618,), (1372078620,), (1372078621,), (1372078623,), (1372078629,), (1372078630,), (1372078631,), (1372078632,), (1372078633,), (1372078634,), (1372078644,), (1372078646,), (1372078648,), (1372078650,), (1372078652,), (1372078654,), (1372078664,), (1372078666,), (1372078667,), (1372078668,), (1372078669,), (1372078671,), (1372078699,), (1372078700,), (1372078701,), (1372078702,), (1372078703,), (1372078704,), (1372078715,), (1372078716,), (1372078718,), (1372078719,), (1372078720,), (1372078721,), (1372078733,), (1372078734,), (1372078735,), (1372078736,), (1372078737,), (1372078738,), (1372078750,), (1372078753,), (1372078757,), (1372078759,), (1372078760,), (1372078761,), (1372078771,), (1372078774,), (1372078776,), (1372078779,), (1372078782,), (1372078784,), (1372078794,), (1372078796,), (1372078797,), (1372078799,), (1372078800,), (1372078801,), (1372078934,), (1372078980,), (1372079025,), (1372079068,), (1372079113,), (1372079158,), (1372079511,), (1372079540,), (1372079566,), (1372079593,), (1372079638,), (1372079686,), (1372080059,), (1372080062,), (1372080065,), (1372080067,), (1372080069,), (1372080071,)) 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 (1372078700,1372078800) 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`=24903073 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('cartonnette','metal','papier','plastique','kraft','Carton_gris','Carton_brun','autre_refus','mal_croppe','Teint_Dans_La_Masse','flou','environnement')) 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`=24903073 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('cartonnette','metal','papier','plastique','kraft','Carton_gris','Carton_brun','autre_refus','mal_croppe','Teint_Dans_La_Masse','flou','environnement')) AND mptpi.`min_score`=0.5 To do returned map {'plastique': {'main_port_id': 24903073, 'sub_port_id': 24903111, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766723, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'kraft': {'main_port_id': 24903073, 'sub_port_id': 24903112, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766724, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'mal_croppe': {'main_port_id': 24903073, 'sub_port_id': 24903113, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766725, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'Carton_brun': {'main_port_id': 24903073, 'sub_port_id': 24903114, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766726, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'metal': {'main_port_id': 24903073, 'sub_port_id': 24903115, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766727, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'cartonnette': {'main_port_id': 24903073, 'sub_port_id': 24903116, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766728, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'flou': {'main_port_id': 24903073, 'sub_port_id': 24903117, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766729, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'autre_refus': {'main_port_id': 24903073, 'sub_port_id': 24903118, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766730, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'environnement': {'main_port_id': 24903073, 'sub_port_id': 24903119, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766731, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'Carton_gris': {'main_port_id': 24903073, 'sub_port_id': 24903120, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766732, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'papier': {'main_port_id': 24903073, 'sub_port_id': 24903121, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766733, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 48, 58), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}, 'Teint_Dans_La_Masse': {'main_port_id': 24903073, 'sub_port_id': 24903122, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 16766734, 'last_updated_at': datetime.datetime(2025, 7, 14, 5, 59), 'last_updated_at_desc': datetime.datetime(2025, 7, 14, 5, 59), 'last_updated_at_asc': datetime.datetime(2025, 7, 14, 5, 48, 58)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903111,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903099 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903112,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903100 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903113,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903101 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903114,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903102 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903115,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903103 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903116,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903104 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903117,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903105 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903118,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903106 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903119,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903107 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903120,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903108 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903121,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903109 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 24903122,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 24903110 lien utilise dans velours : https://www.fotonower.com/velours/24903111,24903112,24903113,24903114,24903115,24903116,24903117,24903118,24903119,24903120,24903121,24903122?tags=plastique,kraft,mal_croppe,Carton_brun,metal,cartonnette,flou,autre_refus,environnement,Carton_gris,papier,Teint_Dans_La_Masse After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([24903073]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] map_info['map_portfolio_photo'] : {24903073: [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059, 1372079686, 1372079638, 1372079593, 1372079566, 1372079540, 1372079511, 1372079158, 1372079113, 1372079068, 1372079025, 1372078980, 1372078934, 1372078801, 1372078800, 1372078799, 1372078797, 1372078796, 1372078794, 1372078784, 1372078782, 1372078779, 1372078776, 1372078774, 1372078771, 1372078761, 1372078760, 1372078759, 1372078757, 1372078753, 1372078750, 1372078738, 1372078737, 1372078736, 1372078735, 1372078734, 1372078733, 1372078721, 1372078720, 1372078719, 1372078718, 1372078716, 1372078715, 1372078704, 1372078703, 1372078702, 1372078701, 1372078700, 1372078699, 1372078671, 1372078669, 1372078668, 1372078667, 1372078666, 1372078664, 1372078654, 1372078652, 1372078650, 1372078648, 1372078646, 1372078644, 1372078634, 1372078633, 1372078632, 1372078631, 1372078630, 1372078629, 1372078623, 1372078621, 1372078620, 1372078618, 1372078617, 1372078615, 1372078608, 1372078607, 1372078606, 1372078605, 1372078603, 1372078599]} final : False mtd_id 4302 list_pids : [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] Looping around the photos to save general results len do output : 1 /24903073. 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, '3278008') ('4302', '24903073', '1372080071', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080069', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080067', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080065', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080062', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080059', None, None, None, None, None, '3278008') 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', None, '24903073', "{'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110}", None, None, None, None, '3278008'), ('4302', '24903073', '1372080071', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080069', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080067', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080065', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080062', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080059', None, None, None, None, None, '3278008')] time used for this insertion : 0.030529022216796875 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.4343745708465576 time spend to save output : 0.030801057815551758 total time spend for step 1 : 0.4651756286621094 step2:final Mon Jul 14 06:00:58 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 (24903073) 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 24903073 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1372078608,1372078607,1372078606,1372078605,1372078603,1372078599,1372078623,1372078621,1372078620,1372078618,1372078617,1372078615,1372078634,1372078633,1372078632,1372078631,1372078630,1372078629,1372078654,1372078652,1372078650,1372078648,1372078646,1372078644,1372078671,1372078669,1372078668,1372078667,1372078666,1372078664,1372078704,1372078703,1372078702,1372078701,1372078700,1372078699,1372078721,1372078720,1372078719,1372078718,1372078716,1372078715,1372078738,1372078737,1372078736,1372078735,1372078734,1372078733,1372078761,1372078760,1372078759,1372078757,1372078753,1372078750,1372078784,1372078782,1372078779,1372078776,1372078774,1372078771,1372078801,1372078800,1372078799,1372078797,1372078796,1372078794,1372079158,1372079113,1372079068,1372079025,1372078980,1372078934,1372079686,1372079638,1372079593,1372079566,1372079540,1372079511,1372080071,1372080069,1372080067,1372080065,1372080062,1372080059); 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([24903073]) Inside saveOutput : final : False verbose : True original output for save of step final : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} new output for save of step final : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] map_info['map_portfolio_photo'] : {24903073: [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059, 1372079686, 1372079638, 1372079593, 1372079566, 1372079540, 1372079511, 1372079158, 1372079113, 1372079068, 1372079025, 1372078980, 1372078934, 1372078801, 1372078800, 1372078799, 1372078797, 1372078796, 1372078794, 1372078784, 1372078782, 1372078779, 1372078776, 1372078774, 1372078771, 1372078761, 1372078760, 1372078759, 1372078757, 1372078753, 1372078750, 1372078738, 1372078737, 1372078736, 1372078735, 1372078734, 1372078733, 1372078721, 1372078720, 1372078719, 1372078718, 1372078716, 1372078715, 1372078704, 1372078703, 1372078702, 1372078701, 1372078700, 1372078699, 1372078671, 1372078669, 1372078668, 1372078667, 1372078666, 1372078664, 1372078654, 1372078652, 1372078650, 1372078648, 1372078646, 1372078644, 1372078634, 1372078633, 1372078632, 1372078631, 1372078630, 1372078629, 1372078623, 1372078621, 1372078620, 1372078618, 1372078617, 1372078615, 1372078608, 1372078607, 1372078606, 1372078605, 1372078603, 1372078599]} final : False mtd_id 4302 list_pids : [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] Looping around the photos to save general results len do output : 6 /1372080071.Didn't retrieve data . /1372080069.Didn't retrieve data . /1372080067.Didn't retrieve data . /1372080065.Didn't retrieve data . /1372080062.Didn't retrieve data . /1372080059.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, '3278008') ('4302', '24903073', '1372080071', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080069', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080067', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080065', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080062', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080059', None, None, None, None, None, '3278008') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 18 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', '24903073', '1372080071', '0.019063080712617073', None, None, None, None, '3278008'), ('4302', '24903073', '1372080069', '0.019063080712617073', None, None, None, None, '3278008'), ('4302', '24903073', '1372080067', '0.019063080712617073', None, None, None, None, '3278008'), ('4302', '24903073', '1372080065', '0.019063080712617073', None, None, None, None, '3278008'), ('4302', '24903073', '1372080062', '0.019063080712617073', None, None, None, None, '3278008'), ('4302', '24903073', '1372080059', '0.019063080712617073', None, None, None, None, '3278008')] time used for this insertion : 0.015476703643798828 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.0740973949432373 time spend to save output : 0.015833616256713867 total time spend for step 2 : 0.08993101119995117 step3:velours_tree Mon Jul 14 06:00:58 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 : {24903073: [{'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110}]} input_args_next_step : {24903073: ()} output_args : {24903073: [{'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110}]} args : 24903073 depend.output_id : 0 VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :1, first value : ({'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (24903073) 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([24903073]) 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.29723596572875977 time spend to save output : 5.316734313964844e-05 total time spend for step 3 : 0.2972891330718994 step4:send_mail_cod Mon Jul 14 06:00:58 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 : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} input_args_next_step : {1372080071: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080071 depend.output_id : 0 input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080069 depend.output_id : 0 input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080067 depend.output_id : 0 input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080065 depend.output_id : 0 input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080062 depend.output_id : 0 input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ()} output_args : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',)} args : 1372080059 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 : {24903073: [{'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110}]} input_args_next_step : {1372080071: ('0.019063080712617073',), 1372080069: ('0.019063080712617073',), 1372080067: ('0.019063080712617073',), 1372080065: ('0.019063080712617073',), 1372080062: ('0.019063080712617073',), 1372080059: ('0.019063080712617073',), 24903073: ()} output_args : {24903073: [{'plastique': 24903099, 'kraft': 24903100, 'mal_croppe': 24903101, 'Carton_brun': 24903102, 'metal': 24903103, 'cartonnette': 24903104, 'flou': 24903105, 'autre_refus': 24903106, 'environnement': 24903107, 'Carton_gris': 24903108, 'papier': 24903109, 'Teint_Dans_La_Masse': 24903110}]} args : 24903073 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 :7, first value : ('0.019063080712617073',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (24903073) 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 (1372080071,1372080069,1372080067,1372080065,1372080062,1372080059) Found this number of photos: 6 ##### Call download_photos : nb_thread : 5 begin to download photo : 1372080059 begin to download photo : 1372080065 begin to download photo : 1372080069 download finish for photo 1372080069 begin to download photo : 1372080071 download finish for photo 1372080059 begin to download photo : 1372080062 download finish for photo 1372080065 begin to download photo : 1372080067 download finish for photo 1372080071 download finish for photo 1372080067 download finish for photo 1372080062 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette249030991752465659/ imagette249031001752465659/ imagette249031011752465659/ imagette249031031752465659/ imagette249031041752465659/ imagette249031051752465659/ imagette249031061752465659/ length of list_filenames : 6 ; length of list_pids : 6 ; length of list_args : 6 results_Auto_P24903073_14-07-2025_06_00_59.pdf 24903099 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=24903099 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249030991752465659 24903100 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=24903100 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031001752465659 24903101 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=24903101 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031011752465659 24903103 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=24903103 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031031752465659 24903104 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=24903104 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031041752465659 24903105 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=24903105 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031051752465659 24903106 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=24903106 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031061752465659 24903102 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=24903102 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1372078713: '1752465086_2542133_1372078652_4821483d6a36696802ffa4778ae46b60_rle_crop_3882807388_0.png', 1372078714: '1752465086_2542133_1372078646_015595389172db04b533b9d1b38d5349_rle_crop_3882807411_0.png', 1372078725: '1752465124_4192561_1372078630_7570dd9182c8837bcb5c79fb501a10eb_rle_crop_3882807561_0.png', 1372078762: '1752465245_3348_1372078703_60d0a7bc784100a97ccdd40f9b42d977_rle_crop_3882807809_0.png', 1372078763: '1752465245_3348_1372078701_f0e085026c8fceadf94632a6af9af3ef_rle_crop_3882807826_0.png', 1372078804: '1752465366_8321_1372078750_93aed0200232ec85c6c829d9da3582fe_rle_crop_3882812624_0.png', 1372079467: '1752465446_2549514_1372078784_2519138fead911bce221d32a43ac5c99_rle_crop_3882815432_0.png', 1372079469: '1752465446_2549514_1372078782_5f1feabbdf74f6d2cf4d5e656830e159_rle_crop_3882815441_0.png', 1372079471: '1752465446_2549514_1372078771_968b4bc24cb78090a9f369a070cb405c_rle_crop_3882815474_0.png', 1372079815: '1752465487_12048_1372078736_589216da8e28e8cc826dfa8725315af2_rle_crop_3882815596_0.png', 1372080057: '1752465566_2552337_1372079638_61bf567591936015927ba7a9299c67df_rle_crop_3882815738_0.png', 1372080058: '1752465566_2552337_1372079511_65cb521d8ce412a1737d9f180a722abb_rle_crop_3882815770_0.png', 1372080075: '1752465607_25400_1372078801_77ad3dfd5b33f85c16b4bbedb69d3c34_rle_crop_3882815880_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/105041dad10a9a2a8a4745a08ae859cf_80851067.png change filename to text .wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/348225e7fa7672af909a8cdf31c3e982_26584961.png change filename to text .wget -O 3.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/2c25bbec1bd148d9e89b336c6af9c849_5594327.png change filename to text .wget -O 4.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/da9c6e03ea38e8dda07c612ce82e2f2c_81877875.png change filename to text .wget -O 5.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/fe7ed9605fb63efc62d873c71a3645fa_11310222.png change filename to text .wget -O 6.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/a5f6f511e518805d237d1d112d2fd985_90485061.png change filename to text .wget -O 7.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/eac651c2f7805fd2358a3cf259e70684_88571586.png change filename to text .wget -O 8.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/1d0654fafa34ae568f95b3fc482bc10f_23103985.png change filename to text .wget -O 9.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/e226f576d7370d20844a9b2f1abaf815_28607596.png change filename to text .wget -O 10.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/632fb2fdc9a10756eb25c65a12f10ef9_23890095.png change filename to text .wget -O 11.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/60ffd29200873f45c3f17a8a6a82777c_63676321.png change filename to text .wget -O 12.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/7eb6321efc0ab8fc4844a8b2a426079c_20252645.png change filename to text .imagette249031021752465659/ imagette249031021752465659/1752465566_2552337_1372079511_65cb521d8ce412a1737d9f180a722abb_rle_crop_3882815770_0.png.png imagette249031021752465659/1752465086_2542133_1372078646_015595389172db04b533b9d1b38d5349_rle_crop_3882807411_0.png.png imagette249031021752465659/1752465446_2549514_1372078771_968b4bc24cb78090a9f369a070cb405c_rle_crop_3882815474_0.png.png imagette249031021752465659/1752465245_3348_1372078703_60d0a7bc784100a97ccdd40f9b42d977_rle_crop_3882807809_0.png.png imagette249031021752465659/1752465124_4192561_1372078630_7570dd9182c8837bcb5c79fb501a10eb_rle_crop_3882807561_0.png.png imagette249031021752465659/1752465366_8321_1372078750_93aed0200232ec85c6c829d9da3582fe_rle_crop_3882812624_0.png.png imagette249031021752465659/1752465566_2552337_1372079638_61bf567591936015927ba7a9299c67df_rle_crop_3882815738_0.png.png imagette249031021752465659/1752465086_2542133_1372078652_4821483d6a36696802ffa4778ae46b60_rle_crop_3882807388_0.png.png imagette249031021752465659/1752465607_25400_1372078801_77ad3dfd5b33f85c16b4bbedb69d3c34_rle_crop_3882815880_0.png.png imagette249031021752465659/1752465446_2549514_1372078784_2519138fead911bce221d32a43ac5c99_rle_crop_3882815432_0.png.png imagette249031021752465659/1752465245_3348_1372078701_f0e085026c8fceadf94632a6af9af3ef_rle_crop_3882807826_0.png.png imagette249031021752465659/1752465446_2549514_1372078782_5f1feabbdf74f6d2cf4d5e656830e159_rle_crop_3882815441_0.png.png imagette249031021752465659/1752465487_12048_1372078736_589216da8e28e8cc826dfa8725315af2_rle_crop_3882815596_0.png.png imagette249031081752465659/ imagette249031101752465659/ wget -O 13.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/7/14/b4846e53435fba71611bcfea46e8b387_44556661.png imagette249031021752465659 24903108 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=24903108 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031081752465659 24903110 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=24903110 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette249031101752465659 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=24903073 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/24903111,24903112,24903113,24903114,24903115,24903116,24903117,24903118,24903119,24903120,24903121,24903122?tags=plastique,kraft,mal_croppe,Carton_brun,metal,cartonnette,flou,autre_refus,environnement,Carton_gris,papier,Teint_Dans_La_Masse your option no_mail is active, we will not send the real mail to your client args[1372080071] : ('0.019063080712617073',) no score found for photo 1372080071 We are sending mail with results at report@fotonower.com args[1372080069] : ('0.019063080712617073',) no score found for photo 1372080069 We are sending mail with results at report@fotonower.com args[1372080067] : ('0.019063080712617073',) no score found for photo 1372080067 We are sending mail with results at report@fotonower.com args[1372080065] : ('0.019063080712617073',) no score found for photo 1372080065 We are sending mail with results at report@fotonower.com args[1372080062] : ('0.019063080712617073',) no score found for photo 1372080062 We are sending mail with results at report@fotonower.com args[1372080059] : ('0.019063080712617073',) no score found for photo 1372080059 We are sending mail with results at report@fotonower.com refus_total : 0.019063080712617073 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=24903073 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_P24903073_14-07-2025_06_00_59.pdf results_Auto_P24903073_14-07-2025_06_00_59.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P24903073_14-07-2025_06_00_59.pdf start insert file to database insert into MTRUser.mtr_files (mtd_id,mtr_portfolio_id,text,url,format,tags,file_size,value) values ('4302','24903073','results_Auto_P24903073_14-07-2025_06_00_59.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P24903073_14-07-2025_06_00_59.pdf','pdf','','0.1','0.019063080712617073') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([24903073]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] map_info['map_portfolio_photo'] : {24903073: [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059, 1372079686, 1372079638, 1372079593, 1372079566, 1372079540, 1372079511, 1372079158, 1372079113, 1372079068, 1372079025, 1372078980, 1372078934, 1372078801, 1372078800, 1372078799, 1372078797, 1372078796, 1372078794, 1372078784, 1372078782, 1372078779, 1372078776, 1372078774, 1372078771, 1372078761, 1372078760, 1372078759, 1372078757, 1372078753, 1372078750, 1372078738, 1372078737, 1372078736, 1372078735, 1372078734, 1372078733, 1372078721, 1372078720, 1372078719, 1372078718, 1372078716, 1372078715, 1372078704, 1372078703, 1372078702, 1372078701, 1372078700, 1372078699, 1372078671, 1372078669, 1372078668, 1372078667, 1372078666, 1372078664, 1372078654, 1372078652, 1372078650, 1372078648, 1372078646, 1372078644, 1372078634, 1372078633, 1372078632, 1372078631, 1372078630, 1372078629, 1372078623, 1372078621, 1372078620, 1372078618, 1372078617, 1372078615, 1372078608, 1372078607, 1372078606, 1372078605, 1372078603, 1372078599]} final : False mtd_id 4302 list_pids : [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] 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, '3278008') ('4302', '24903073', '1372080071', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080069', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080067', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080065', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080062', None, None, None, None, None, '3278008') ('4302', None, None, None, None, None, None, None, '3278008') ('4302', '24903073', '1372080059', None, None, None, None, None, '3278008') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 6 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', '24903073', '1372080071', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080069', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080067', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080065', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080062', None, None, None, None, None, '3278008'), ('4302', '24903073', '1372080059', None, None, None, None, None, '3278008')] time used for this insertion : 0.01403355598449707 save_final save missing photos in datou_result : time spend for datou_step_exec : 1.992661476135254 time spend to save output : 0.014261007308959961 total time spend for step 4 : 2.006922483444214 step5:split_time_score Mon Jul 14 06:01: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 complete output_args for input 0 : ['24903073'] 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 : [('24903073',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (24903073) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1372080069: {'path': 'temp/1752465658_2176580_1372080069_3f4686d01d75ce9b9243d9de40fc3fe0.jpg', 'extension': 'jpg'}, 1372080071: {'path': 'temp/1752465658_2176580_1372080071_67c9acafb31415ba9a84f9b3e6fa157b.jpg', 'extension': 'jpg'}, 1372080065: {'path': 'temp/1752465658_2176580_1372080065_18705f4278e09e71a265f59cc35fc8d0.jpg', 'extension': 'jpg'}, 1372080067: {'path': 'temp/1752465658_2176580_1372080067_d1f1fed1b3026d2e0849fd38795d0a04.jpg', 'extension': 'jpg'}, 1372080059: {'path': 'temp/1752465658_2176580_1372080059_a59783094c1bc85f256b86e124948c0e.jpg', 'extension': 'jpg'}, 1372080062: {'path': 'temp/1752465658_2176580_1372080062_ba9ec60938abc0c46d6265721c0eabf0.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 = 24903073; (('arc_en_ciel_jrm_live',), ('arc_en_ciel_jrm_bis',)) dashboard list : (('arc_en_ciel_jrm_live',), ('arc_en_ciel_jrm_bis',)) can't retrive data from the dashboard with the suffix, please check suffix After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([24903073]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] map_info['map_portfolio_photo'] : {24903073: [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059, 1372079686, 1372079638, 1372079593, 1372079566, 1372079540, 1372079511, 1372079158, 1372079113, 1372079068, 1372079025, 1372078980, 1372078934, 1372078801, 1372078800, 1372078799, 1372078797, 1372078796, 1372078794, 1372078784, 1372078782, 1372078779, 1372078776, 1372078774, 1372078771, 1372078761, 1372078760, 1372078759, 1372078757, 1372078753, 1372078750, 1372078738, 1372078737, 1372078736, 1372078735, 1372078734, 1372078733, 1372078721, 1372078720, 1372078719, 1372078718, 1372078716, 1372078715, 1372078704, 1372078703, 1372078702, 1372078701, 1372078700, 1372078699, 1372078671, 1372078669, 1372078668, 1372078667, 1372078666, 1372078664, 1372078654, 1372078652, 1372078650, 1372078648, 1372078646, 1372078644, 1372078634, 1372078633, 1372078632, 1372078631, 1372078630, 1372078629, 1372078623, 1372078621, 1372078620, 1372078618, 1372078617, 1372078615, 1372078608, 1372078607, 1372078606, 1372078605, 1372078603, 1372078599]} final : True mtd_id 4302 list_pids : [1372080071, 1372080069, 1372080067, 1372080065, 1372080062, 1372080059] Looping around the photos to save general results object of type 'int' has no len() begin to insert list_values into mtr_datou_result : length of list_values in save_final : 6 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', '24903073', '1372080071', '0', '0', '-1.0', '501120777', '1.0', '3278008'), ('4302', '24903073', '1372080069', '0', '0', '-1.0', '501120777', '1.0', '3278008'), ('4302', '24903073', '1372080067', '0', '0', '-1.0', '501120777', '1.0', '3278008'), ('4302', '24903073', '1372080065', '0', '0', '-1.0', '501120777', '1.0', '3278008'), ('4302', '24903073', '1372080062', '0', '0', '-1.0', '501120777', '1.0', '3278008'), ('4302', '24903073', '1372080059', '0', '0', '-1.0', '501120777', '1.0', '3278008')] time used for this insertion : 0.014917373657226562 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.0247647762298584 time spend to save output : 0.015095233917236328 total time spend for step 5 : 0.03986001014709473 UPDATE MTRPhoto.mtr_datou_current SET state=-11, hostname='marlene' WHERE id in (3278008) 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 (3278008) 1.83user 2.36system 0:06.15elapsed 68%CPU (0avgtext+0avgdata 161412maxresident)k 104inputs+4952outputs (1major+63908minor)pagefaults 0swaps