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 : 2804212 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 (2696063) updating current state to 1 UPDATE MTRPhoto.mtr_datou_current SET state=1, hostname='marlene' WHERE id in (2696063) SELECT count(*) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772390 AND hide_status = 0 list_input_json: [] Current got : datou_id : 4302, datou_cur_ids : ['2696063'] with mtr_portfolio_ids : ['21772390'] and first list_photo_ids : [] new path : /proc/2804212/ Name: python3 Umask: 0002 State: R (running) Tgid: 2804212 Ngid: 0 Pid: 2804212 PPid: 2804211 TracerPid: 0 Uid: 1006 1006 1006 1006 Gid: 1009 1009 1009 1009 FDSize: 64 Groups: 27 1009 1026 NStgid: 2804212 NSpid: 2804212 NSpgid: 2801761 NSsid: 2801761 VmPeak: 1106928 kB VmSize: 1106928 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 98604 kB VmRSS: 98604 kB RssAnon: 59796 kB RssFile: 38808 kB RssShmem: 0 kB VmData: 865676 kB VmStk: 132 kB VmExe: 2644 kB VmLib: 130468 kB VmPTE: 608 kB VmSwap: 0 kB HugetlbPages: 0 kB CoreDumping: 0 THP_enabled: 1 Threads: 1 SigQ: 1/63054 SigPnd: 0000000000000000 ShdPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000001001000 SigCgt: 0000000180000002 CapInh: 0000000000000000 CapPrm: 0000000000000000 CapEff: 0000000000000000 CapBnd: 000001ffffffffff CapAmb: 0000000000000000 NoNewPrivs: 0 Seccomp: 0 Seccomp_filters: 0 Speculation_Store_Bypass: thread vulnerable SpeculationIndirectBranch: conditional enabled Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff Cpus_allowed_list: 0-127 Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 Mems_allowed_list: 0 voluntary_ctxt_switches: 46 nonvoluntary_ctxt_switches: 82 {'Name': 'python3', 'Umask': '0002', 'State': 'R (running)', 'Tgid': '2804212', 'Ngid': '0', 'Pid': '2804212', 'PPid': '2804211', 'TracerPid': '0', 'Uid': '1006,1006,1006,1006', 'Gid': '1009,1009,1009,1009', 'FDSize': '64', 'Groups': '27 1009 1026', 'NStgid': '2804212', 'NSpid': '2804212', 'NSpgid': '2801761', 'NSsid': '2801761', 'VmPeak': '1106928 kB', 'VmSize': '1106928 kB', 'VmLck': '0 kB', 'VmPin': '0 kB', 'VmHWM': '98604 kB', 'VmRSS': '98604 kB', 'RssAnon': '59796 kB', 'RssFile': '38808 kB', 'RssShmem': '0 kB', 'VmData': '865676 kB', 'VmStk': '132 kB', 'VmExe': '2644 kB', 'VmLib': '130468 kB', 'VmPTE': '608 kB', 'VmSwap': '0 kB', 'HugetlbPages': '0 kB', 'CoreDumping': '0', 'THP_enabled': '1', 'Threads': '1', 'SigQ': '1/63054', 'SigPnd': '0000000000000000', 'ShdPnd': '0000000000000000', 'SigBlk': '0000000000000000', 'SigIgn': '0000000001001000', 'SigCgt': '0000000180000002', 'CapInh': '0000000000000000', 'CapPrm': '0000000000000000', 'CapEff': '0000000000000000', 'CapBnd': '000001ffffffffff', 'CapAmb': '0000000000000000', 'NoNewPrivs': '0', 'Seccomp': '0', 'Seccomp_filters': '0', 'Speculation_Store_Bypass': 'thread vulnerable', 'SpeculationIndirectBranch': 'conditional enabled', 'Cpus_allowed': 'ffffffff,ffffffff,ffffffff,ffffffff', 'Cpus_allowed_list': '0-127', 'Mems_allowed': '00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001', 'Mems_allowed_list': '0', 'voluntary_ctxt_switches': '46', 'nonvoluntary_ctxt_switches': '82'} ('datou_batch_current', '2804212', '1106928', '0', '1106928', '865676', '98604', b'', 'marlene', '2696063') 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 (21772390) 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 (2696063 ) ) 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 (21772390) AND hide_status = 0 ORDER by mtr_photo_id desc LIMIT 0, 200 list_result: [{'photo_id': 1347762376, 'portfolio_id': 21772390}, {'photo_id': 1347762345, 'portfolio_id': 21772390}, {'photo_id': 1347762220, 'portfolio_id': 21772390}, {'photo_id': 1347762205, 'portfolio_id': 21772390}, {'photo_id': 1347762203, 'portfolio_id': 21772390}, {'photo_id': 1347761967, 'portfolio_id': 21772390}, {'photo_id': 1347761904, 'portfolio_id': 21772390}, {'photo_id': 1347761801, 'portfolio_id': 21772390}, {'photo_id': 1347761740, 'portfolio_id': 21772390}, {'photo_id': 1347761728, 'portfolio_id': 21772390}, {'photo_id': 1347761726, 'portfolio_id': 21772390}] map_portfolio_id_photo_id: {21772390: [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726]} ##### 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.015085220336914062 #### 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 Thu Mar 27 06:23:59 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (21772390) 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 : 21772390 get user id for portfolio 21772390 get sub ptf for main ptf 21772390, type 3726 and hashtags ['plastique', 'mal_croppe', 'papier', 'Teint_Dans_La_Masse', 'cartonnette', 'autre_refus', 'kraft', 'metal', 'flou', 'Carton_brun', 'environnement', 'Carton_gris'] 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`=21772390 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) 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`=21772390 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_plastique_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_mal_croppe_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_papier_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_Teint_Dans_La_Masse_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_autre_refus_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_kraft_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_metal_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_flou_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_Carton_brun_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_environnement_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_3726_Carton_gris_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio INSERT IGNORE INTO MTRPhoto.mtr_port_to_port_ids (`mtr_portfolio_id_1`, `mtr_portfolio_id_2`, `type`, `min_score`, `hashtag_id`, `mtr_user_id`) VALUES (%s,%s,%s,%s,%s,%s)[[21772390, 21772391, 3726, 0.5, 492725882, 979], [21772390, 21772392, 3726, 0.5, 2107755527, 979], [21772390, 21772393, 3726, 0.5, 492668766, 979], [21772390, 21772394, 3726, 0.5, 2107752385, 979], [21772390, 21772395, 3726, 0.5, 702398920, 979], [21772390, 21772396, 3726, 0.5, 2107752406, 979], [21772390, 21772397, 3726, 0.5, 493202403, 979], [21772390, 21772398, 3726, 0.5, 492628673, 979], [21772390, 21772399, 3726, 0.5, 492777938, 979], [21772390, 21772400, 3726, 0.5, 2107753024, 979], [21772390, 21772401, 3726, 0.5, 493012381, 979], [21772390, 21772402, 3726, 0.5, 2107753020, 979]] SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21772390 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) 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`=21772390 AND mptpi.`type`=3726 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) AND mptpi.`min_score`=0.5 To do returned map {'plastique': {'main_port_id': 21772390, 'sub_port_id': 21772391, 'hashtag': 'plastique', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294707, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'mal_croppe': {'main_port_id': 21772390, 'sub_port_id': 21772392, 'hashtag': 'mal_croppe', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294708, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'papier': {'main_port_id': 21772390, 'sub_port_id': 21772393, 'hashtag': 'papier', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294709, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'Teint_Dans_La_Masse': {'main_port_id': 21772390, 'sub_port_id': 21772394, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294710, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'cartonnette': {'main_port_id': 21772390, 'sub_port_id': 21772395, 'hashtag': 'cartonnette', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294711, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'autre_refus': {'main_port_id': 21772390, 'sub_port_id': 21772396, 'hashtag': 'autre_refus', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294712, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'kraft': {'main_port_id': 21772390, 'sub_port_id': 21772397, 'hashtag': 'kraft', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294713, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'metal': {'main_port_id': 21772390, 'sub_port_id': 21772398, 'hashtag': 'metal', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294714, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'flou': {'main_port_id': 21772390, 'sub_port_id': 21772399, 'hashtag': 'flou', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294715, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'Carton_brun': {'main_port_id': 21772390, 'sub_port_id': 21772400, 'hashtag': 'Carton_brun', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294716, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'environnement': {'main_port_id': 21772390, 'sub_port_id': 21772401, 'hashtag': 'environnement', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294717, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}, 'Carton_gris': {'main_port_id': 21772390, 'sub_port_id': 21772402, 'hashtag': 'Carton_gris', 'pht': 3726, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294718, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 1), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 1)}} insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772391 , 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=21772390 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 (21772391) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772392 , 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=21772390 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 (21772392) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772393 , 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=21772390 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 (21772393) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772394 , 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=21772390 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 (21772394) result : ((1347762343,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772395 , 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=21772390 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 (21772395) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772396 , 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=21772390 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 (21772396) result : ((1347762347,), (1347762348,)) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772397 , 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=21772390 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 (21772397) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772398 , 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=21772390 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 (21772398) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772399 , 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=21772390 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 (21772399) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772400 , 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=21772390 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 (21772400) result : ((1347762350,),) SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772401 , 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=21772390 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 (21772401) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") insert ignore into MTRUser.mtr_portfolio_photos (mtr_portfolio_id, mtr_photo_id, mtr_user_id,created_at) SELECT 21772402 , 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=21772390 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 (21772402) result : () SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21772390) result : ((1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) select distinct(cspi.sub_photo_id) from MTRPhoto.crop_hashtag_ids chi, MTRPhoto.crop_sub_photo_ids cspi where chi.type=3726 and chi.photo_id in () and cspi.crop_hashtag_id = chi.id; Catched exception ! Connect or reconnect ! (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')\n and cspi.crop_hashtag_id = chi.id' at line 3") To do ! Use context local managing function ! SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21772390 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) 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`=21772390 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) AND mptpi.`min_score`=0.5 To do To do query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_plastique_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_mal_croppe_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_papier_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_Teint_Dans_La_Masse_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_cartonnette_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_autre_refus_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_kraft_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_metal_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_flou_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_Carton_brun_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_environnement_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio query : SELECT id FROM MTRUser.mtr_portfolios WHERE name="JRM_diff_batch__27032025_06_15_03_10156_4417_Carton_gris_0.5_chtin_0" AND mtr_user_id=979 Creating new portfolio INSERT IGNORE INTO MTRPhoto.mtr_port_to_port_ids (`mtr_portfolio_id_1`, `mtr_portfolio_id_2`, `type`, `min_score`, `hashtag_id`, `mtr_user_id`) VALUES (%s,%s,%s,%s,%s,%s)[[21772390, 21772403, 4417, 0.5, 492725882, 979], [21772390, 21772404, 4417, 0.5, 2107755527, 979], [21772390, 21772405, 4417, 0.5, 492668766, 979], [21772390, 21772406, 4417, 0.5, 2107752385, 979], [21772390, 21772407, 4417, 0.5, 702398920, 979], [21772390, 21772408, 4417, 0.5, 2107752406, 979], [21772390, 21772409, 4417, 0.5, 493202403, 979], [21772390, 21772410, 4417, 0.5, 492628673, 979], [21772390, 21772411, 4417, 0.5, 492777938, 979], [21772390, 21772412, 4417, 0.5, 2107753024, 979], [21772390, 21772413, 4417, 0.5, 493012381, 979], [21772390, 21772414, 4417, 0.5, 2107753020, 979]] SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21772390 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) 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`=21772390 AND mptpi.`type`=4417 AND mptpi.`hashtag_id` in (select hashtag_id FROM MTRBack.hashtags where hashtag in ('plastique','mal_croppe','papier','Teint_Dans_La_Masse','cartonnette','autre_refus','kraft','metal','flou','Carton_brun','environnement','Carton_gris')) AND mptpi.`min_score`=0.5 To do returned map {'plastique': {'main_port_id': 21772390, 'sub_port_id': 21772403, 'hashtag': 'plastique', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294719, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'mal_croppe': {'main_port_id': 21772390, 'sub_port_id': 21772404, 'hashtag': 'mal_croppe', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294720, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'papier': {'main_port_id': 21772390, 'sub_port_id': 21772405, 'hashtag': 'papier', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294721, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'Teint_Dans_La_Masse': {'main_port_id': 21772390, 'sub_port_id': 21772406, 'hashtag': 'Teint_Dans_La_Masse', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294722, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'cartonnette': {'main_port_id': 21772390, 'sub_port_id': 21772407, 'hashtag': 'cartonnette', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294723, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'autre_refus': {'main_port_id': 21772390, 'sub_port_id': 21772408, 'hashtag': 'autre_refus', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294724, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'kraft': {'main_port_id': 21772390, 'sub_port_id': 21772409, 'hashtag': 'kraft', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294725, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'metal': {'main_port_id': 21772390, 'sub_port_id': 21772410, 'hashtag': 'metal', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294726, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'flou': {'main_port_id': 21772390, 'sub_port_id': 21772411, 'hashtag': 'flou', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294727, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'Carton_brun': {'main_port_id': 21772390, 'sub_port_id': 21772412, 'hashtag': 'Carton_brun', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294728, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'environnement': {'main_port_id': 21772390, 'sub_port_id': 21772413, 'hashtag': 'environnement', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294729, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}, 'Carton_gris': {'main_port_id': 21772390, 'sub_port_id': 21772414, 'hashtag': 'Carton_gris', 'pht': 4417, 'min_score': 0.5, 'mtr_user_id': 979, 'id': 14294730, 'last_updated_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_desc': datetime.datetime(2025, 3, 27, 6, 24, 3), 'last_updated_at_asc': datetime.datetime(2025, 3, 27, 6, 24, 3)}} insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772403,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772391 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772404,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772392 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772405,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772393 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772406,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772394 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772407,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772395 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772408,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772396 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772409,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772397 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772410,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772398 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772411,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772399 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772412,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772400 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772413,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772401 insert ignore into MTRUser.mtr_portfolio_photos(mtr_portfolio_id,mtr_photo_id,mtr_user_id) select 21772414,mtr_photo_id,mtr_user_id from MTRUser.mtr_portfolio_photos where mtr_portfolio_id = 21772402 lien utilise dans velours : https://www.fotonower.com/velours/21772403,21772404,21772405,21772406,21772407,21772408,21772409,21772410,21772411,21772412,21772413,21772414?tags=plastique,mal_croppe,papier,Teint_Dans_La_Masse,cartonnette,autre_refus,kraft,metal,flou,Carton_brun,environnement,Carton_gris After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([21772390]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : ventilate_hashtags_in_portfolio we use saveGeneral [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] map_info['map_portfolio_photo'] : {21772390: [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726]} final : False mtd_id 4302 list_pids : [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] Looping around the photos to save general results len do output : 1 /21772390. 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, '2696063') ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 12 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, '21772390', "{'plastique': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402}", None, None, None, None, '2696063'), ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063')] time used for this insertion : 0.015059232711791992 save_final save missing photos in datou_result : time spend for datou_step_exec : 3.251983165740967 time spend to save output : 0.015373706817626953 total time spend for step 1 : 3.2673568725585938 step2:final Thu Mar 27 06:24:03 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! VR 22-3-18 : For now we do not clean correctly the datou structure input_args_next_step, len :0, first value : [] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (21772390) 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 21772390 : SELECT photo_id, hashtag_id, ratio from MTRPhoto.photo_carac_ratio where hashtag_type = 3726 and photo_id in (1347761740,1347761728,1347761726,1347761801,1347761967,1347761904,1347762376,1347762345,1347762220,1347762205,1347762203); 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([21772390]) Inside saveOutput : final : False verbose : True original output for save of step final : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} new output for save of step final : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] map_info['map_portfolio_photo'] : {21772390: [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726]} final : False mtd_id 4302 list_pids : [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] Looping around the photos to save general results len do output : 11 /1347762376.Didn't retrieve data . /1347762345.Didn't retrieve data . /1347762220.Didn't retrieve data . /1347762205.Didn't retrieve data . /1347762203.Didn't retrieve data . /1347761967.Didn't retrieve data . /1347761904.Didn't retrieve data . /1347761801.Didn't retrieve data . /1347761740.Didn't retrieve data . /1347761728.Didn't retrieve data . /1347761726.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, '2696063') ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 33 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', '21772390', '1347762376', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347762345', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347762220', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347762205', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347762203', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761967', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761904', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761801', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761740', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761728', '0.026743991658349602', None, None, None, None, '2696063'), ('4302', '21772390', '1347761726', '0.026743991658349602', None, None, None, None, '2696063')] time used for this insertion : 0.016388416290283203 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.029942035675048828 time spend to save output : 0.016887903213500977 total time spend for step 2 : 0.046829938888549805 step3:velours_tree Thu Mar 27 06:24:03 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : {21772390: [{'plastique': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402}]} input_args_next_step : {21772390: ()} output_args : {21772390: [{'plastique': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402}]} args : 21772390 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': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402},) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (21772390) 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([21772390]) 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.3262929916381836 time spend to save output : 4.315376281738281e-05 total time spend for step 3 : 0.326336145401001 step4:send_mail_cod Thu Mar 27 06:24:03 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! We should have FATAL ERROR but same_nb_input_output==True : this should be an optionnal input ! complete output_args for input 2 : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} input_args_next_step : {1347762376: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347762376 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347762345 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347762220 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347762205 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347762203 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761967 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761904 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761801 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761740 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761728 depend.output_id : 0 input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ()} output_args : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',)} args : 1347761726 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 : {21772390: [{'plastique': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402}]} input_args_next_step : {1347762376: ('0.026743991658349602',), 1347762345: ('0.026743991658349602',), 1347762220: ('0.026743991658349602',), 1347762205: ('0.026743991658349602',), 1347762203: ('0.026743991658349602',), 1347761967: ('0.026743991658349602',), 1347761904: ('0.026743991658349602',), 1347761801: ('0.026743991658349602',), 1347761740: ('0.026743991658349602',), 1347761728: ('0.026743991658349602',), 1347761726: ('0.026743991658349602',), 21772390: ()} output_args : {21772390: [{'plastique': 21772391, 'mal_croppe': 21772392, 'papier': 21772393, 'Teint_Dans_La_Masse': 21772394, 'cartonnette': 21772395, 'autre_refus': 21772396, 'kraft': 21772397, 'metal': 21772398, 'flou': 21772399, 'Carton_brun': 21772400, 'environnement': 21772401, 'Carton_gris': 21772402}]} args : 21772390 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 :12, first value : ('0.026743991658349602',) After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (21772390) 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 (1347762376,1347762345,1347762220,1347762205,1347762203,1347761967,1347761904,1347761801,1347761740,1347761728,1347761726) Found this number of photos: 11 ##### Call download_photos : nb_thread : 5 begin to download photo : 1347761726 begin to download photo : 1347761801 begin to download photo : 1347762203 begin to download photo : 1347762345 download finish for photo 1347761801 begin to download photo : 1347761904 download finish for photo 1347762203 begin to download photo : 1347762205 download finish for photo 1347761726 begin to download photo : 1347761728 download finish for photo 1347762345 begin to download photo : 1347762376 download finish for photo 1347761904 begin to download photo : 1347761967 download finish for photo 1347762376 download finish for photo 1347761728 begin to download photo : 1347761740 download finish for photo 1347762205 begin to download photo : 1347762220 download finish for photo 1347761967 download finish for photo 1347761740 download finish for photo 1347762220 we have missing 0 photos in the step downloads : photo missing : [] try to delete the photos missing in DB ##### After download_photos imagette217723911743053043/ imagette217723921743053043/ imagette217723951743053043/ length of list_filenames : 11 ; length of list_pids : 11 ; length of list_args : 11 results_Auto_P21772390_27-03-2025_06_24_03.pdf 21772391 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=21772391 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723911743053043 21772392 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=21772392 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723921743053043 21772395 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=21772395 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723951743053043 21772396 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=21772396 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1347762347: '1743052913_3010261_1347761801_63f4929a798e6314b2e7f4b6515e3eee_rle_crop_3733087328_0.png', 1347762348: '1743052913_3010261_1347761740_585576e91e202020dc669868eaaadc8b_rle_crop_3733087191_0.png'} change filename to text .wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/a14fb91e1b45239adbee690cde3bed35_88702902.png change filename to text .imagette217723961743053043/ imagette217723961743053043/1743052913_3010261_1347761740_585576e91e202020dc669868eaaadc8b_rle_crop_3733087191_0.png.png imagette217723961743053043/1743052913_3010261_1347761801_63f4929a798e6314b2e7f4b6515e3eee_rle_crop_3733087328_0.png.png imagette217723971743053044/ imagette217723981743053044/ imagette217723991743053044/ wget -O 2.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/d0d9528b5fcdb96300caf22650e7e8cb_90330953.png imagette217723961743053043 21772397 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=21772397 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723971743053044 21772398 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=21772398 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723981743053044 21772399 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=21772399 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217723991743053044 21772394 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=21772394 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1347762343: '1743052913_3010261_1347761726_7a8bad4fd9102d1ce61fe7538815ebad_rle_crop_3733087210_0.png'} change filename to text .imagette217723941743053044/ imagette217723941743053044/1743052913_3010261_1347761726_7a8bad4fd9102d1ce61fe7538815ebad_rle_crop_3733087210_0.png.png wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/766fd03345ecfbc0d16d1c84ca411a70_50483114.png imagette217723941743053044 21772400 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=21772400 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {1347762350: '1743052913_3010261_1347761728_4e26c4b0fefb83ff7f0dc1b5512e28ca_rle_crop_3733087200_0.png'} change filename to text .imagette217724001743053044/ imagette217724001743053044/1743052913_3010261_1347761728_4e26c4b0fefb83ff7f0dc1b5512e28ca_rle_crop_3733087200_0.png.png imagette217724021743053044/ wget -O 1.png http://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/37422919d1152fd986f9c1b8f7ca6d0c_54458140.png imagette217724001743053044 21772402 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=21772402 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 20 map_photo_id_text : {} imagette217724021743053044 SELECT h.hashtag,pcr.value FROM MTRUser.portfolio_carac_ratio pcr, MTRBack.hashtags h where pcr.portfolio_id=21772390 and hashtag_type = 3726 and pcr.hashtag_id = h.hashtag_id; velour_link : https://www.fotonower.com/velours/21772403,21772404,21772405,21772406,21772407,21772408,21772409,21772410,21772411,21772412,21772413,21772414?tags=plastique,mal_croppe,papier,Teint_Dans_La_Masse,cartonnette,autre_refus,kraft,metal,flou,Carton_brun,environnement,Carton_gris your option no_mail is active, we will not send the real mail to your client args[1347762376] : ('0.026743991658349602',) no score found for photo 1347762376 We are sending mail with results at report@fotonower.com args[1347762345] : ('0.026743991658349602',) no score found for photo 1347762345 We are sending mail with results at report@fotonower.com args[1347762220] : ('0.026743991658349602',) no score found for photo 1347762220 We are sending mail with results at report@fotonower.com args[1347762205] : ('0.026743991658349602',) no score found for photo 1347762205 We are sending mail with results at report@fotonower.com args[1347762203] : ('0.026743991658349602',) no score found for photo 1347762203 We are sending mail with results at report@fotonower.com args[1347761967] : ('0.026743991658349602',) no score found for photo 1347761967 We are sending mail with results at report@fotonower.com args[1347761904] : ('0.026743991658349602',) no score found for photo 1347761904 We are sending mail with results at report@fotonower.com args[1347761801] : ('0.026743991658349602',) no score found for photo 1347761801 We are sending mail with results at report@fotonower.com args[1347761740] : ('0.026743991658349602',) no score found for photo 1347761740 We are sending mail with results at report@fotonower.com args[1347761728] : ('0.026743991658349602',) no score found for photo 1347761728 We are sending mail with results at report@fotonower.com args[1347761726] : ('0.026743991658349602',) no score found for photo 1347761726 We are sending mail with results at report@fotonower.com refus_total : 0.026743991658349602 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=21772390 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_P21772390_27-03-2025_06_24_03.pdf results_Auto_P21772390_27-03-2025_06_24_03.pdf uploaded to url https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21772390_27-03-2025_06_24_03.pdf start insert file to database insert into MTRUser.mtr_files (mtd_id,mtr_portfolio_id,text,url,format,tags,file_size,value) values ('4302','21772390','results_Auto_P21772390_27-03-2025_06_24_03.pdf','https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21772390_27-03-2025_06_24_03.pdf','pdf','','0.1','0.026743991658349602') After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([21772390]) Inside saveOutput : final : False verbose : True saveOutput not yet implemented for datou_step.type : send_mail_cod we use saveGeneral [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] map_info['map_portfolio_photo'] : {21772390: [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726]} final : False mtd_id 4302 list_pids : [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] 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, '2696063') ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 11 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', '21772390', '1347762376', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063')] time used for this insertion : 0.0201570987701416 save_final save missing photos in datou_result : time spend for datou_step_exec : 2.1015994548797607 time spend to save output : 0.0203704833984375 total time spend for step 4 : 2.1219699382781982 step5:split_time_score Thu Mar 27 06:24:05 2025 VR 17-11-17 : now, only for linear exec dependencies tree, some output goes to fill the input of the next VR 22-3-18 : now we test the dependencies tree, but keep two separate code for datou_prepare_output_input until the code is correctly tested, clean and works in both case VR 22-3-18 : but we use the first code for the first step id = -1, build in the code of datou_exec VR 22-3-18 : we should manage here the case when we are at the first step instead of building this step before datou_exec Currently we do not manage missing dependencies information, that could maybe be correctly interpreted with default behavior Some of the step done at execution of the step could be done before when the tree of execution is build and the dependencies of different step analysed complete output_args for input 0 : ['21772390'] 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 : [('21772390',)] After prepare type args : select max(UNIX_TIMESTAMP(created_at)) from MTRUser.mtr_portfolio_photos where mtr_portfolio_id in (21772390) Here we display some param of map_info ! map_filenames : {} map_photo_id_path_extension : {1347762345: {'path': 'temp/1743053043_2804212_1347762345_b952d60f72a6548b529ce3231e779457.jpg', 'extension': 'jpg'}, 1347762376: {'path': 'temp/1743053043_2804212_1347762376_ed809bf4f5087a8594d6324f4948860a.jpg', 'extension': 'jpg'}, 1347761801: {'path': 'temp/1743053043_2804212_1347761801_63f4929a798e6314b2e7f4b6515e3eee.jpg', 'extension': 'jpg'}, 1347761904: {'path': 'temp/1743053043_2804212_1347761904_68264f5d3637646dfc501fa2596864d8.jpg', 'extension': 'jpg'}, 1347761967: {'path': 'temp/1743053043_2804212_1347761967_bf0f513f9d9baf3f011a8e63cbf42f4c.jpg', 'extension': 'jpg'}, 1347761726: {'path': 'temp/1743053043_2804212_1347761726_7a8bad4fd9102d1ce61fe7538815ebad.jpg', 'extension': 'jpg'}, 1347761728: {'path': 'temp/1743053043_2804212_1347761728_4e26c4b0fefb83ff7f0dc1b5512e28ca.jpg', 'extension': 'jpg'}, 1347761740: {'path': 'temp/1743053043_2804212_1347761740_585576e91e202020dc669868eaaadc8b.jpg', 'extension': 'jpg'}, 1347762203: {'path': 'temp/1743053043_2804212_1347762203_82ac68bf77dd53e6c4357060daf60f7b.jpg', 'extension': 'jpg'}, 1347762205: {'path': 'temp/1743053043_2804212_1347762205_ba3a5ad874e4a4d8f28af4e8c6901c65.jpg', 'extension': 'jpg'}, 1347762220: {'path': 'temp/1743053043_2804212_1347762220_d018dcbb20b1a627d6cd62daaee4d6dd.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 = 21772390; (('arc_en_ciel_jrm',),) TODO : Insert select and so on Begin split_port_in_batch_balle thcls : [{'id': 861, 'mtr_user_id': 31, 'name': 'Rungis_class_dechets_1212', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': 'Rungis_Aluminium,Rungis_Carton,Rungis_Papier,Rungis_Plastique_clair,Rungis_Plastique_dur,Rungis_Plastique_fonce,Rungis_Tapis_vide,Rungis_Tetrapak', 'svm_portfolios_learning': '1160730,571842,571844,571839,571933,571840,571841,572307', 'photo_hashtag_type': 999, 'photo_desc_type': 3963, 'type_classification': 'caffe', 'hashtag_id_list': '2107751280,2107750907,2107750908,2107750909,2107750910,2107750911,2107750912,2107750913'}] thcls : [{'id': 758, 'mtr_user_id': 31, 'name': 'Rungis_amount_dechets_fall_2018_v2', 'pb_hashtag_id': 0, 'live': b'\x00', 'list_hashtags': '05102018_Papier_non_papier_dense,05102018_Papier_non_papier_peu_dense,05102018_Papier_non_papier_presque_vide,05102018_Papier_non_papier_tres_dense,05102018_Papier_non_papier_tres_peu_dense', 'svm_portfolios_learning': '1108385,1108386,1108388,1108384,1108387', 'photo_hashtag_type': 856, 'photo_desc_type': 3853, 'type_classification': 'caffe', 'hashtag_id_list': '2107751013,2107751014,2107751015,2107751016,2107751017'}] select SUBSTRING(ph.text,16,2) as h, count(*) from MTRUser.mtr_portfolio_photos mpp inner join MTRBack.photos ph on mpp.mtr_photo_id = ph.photo_id where mpp.mtr_portfolio_id = 21772390 group by h (('06', 11),) 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=21772390 AND mpp.hide_status=0 ORDER BY mpp.order LIMIT 0, 100000 SELECT cps.photo_id, cps.score, h.hashtag, cps.hashtag_id, mpp1.mtr_portfolio_id FROM MTRPhoto.class_photo_score cps, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp1 where mpp1.mtr_photo_id=cps.photo_id AND h.hashtag_id=cps.hashtag_id AND mpp1.hide_status=0 AND mpp1.mtr_portfolio_id in (21772390) AND cps.thcl in (861) order by cps.score desc LIMIT 0, 100000 SELECT cps.photo_id, cps.score, h.hashtag, cps.hashtag_id, mpp1.mtr_portfolio_id FROM MTRPhoto.class_photo_score cps, MTRBack.hashtags h, MTRUser.mtr_portfolio_photos mpp1 where mpp1.mtr_photo_id=cps.photo_id AND h.hashtag_id=cps.hashtag_id AND mpp1.hide_status=0 AND mpp1.mtr_portfolio_id in (21772390) AND cps.thcl in (758) order by cps.score desc LIMIT 0, 100000 ERROR counted https://github.com/fotonower/Velours/issues/663#issuecomment-421136223 {} 27032025 21772390 Nombre de photos uploadées : 11 / 23040 (0%) 27032025 21772390 Nombre de photos taguées (types de déchets): 0 / 11 (0%) 27032025 21772390 Nombre de photos taguées (volume) : 0 / 11 (0%) [{'photo_id': 1347761740, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/585576e91e202020dc669868eaaadc8b.jpg', 'username': None, 'uploaded_at': 1743052636, 'text': 'image_27032025_06_15_03_010154m0.jpg 1e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1347761728, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/4e26c4b0fefb83ff7f0dc1b5512e28ca.jpg', 'username': None, 'uploaded_at': 1743052636, 'text': 'image_27032025_06_15_13_010149m0.jpg 2e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1347761726, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/7a8bad4fd9102d1ce61fe7538815ebad.jpg', 'username': None, 'uploaded_at': 1743052636, 'text': 'image_27032025_06_15_24_010141m0.jpg 3.0000000000000004e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}, {'photo_id': 1347761801, 'url': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/2025/3/27/63f4929a798e6314b2e7f4b6515e3eee.jpg', 'username': None, 'uploaded_at': 1743052696, 'text': 'image_27032025_06_15_54_010138m0.jpg 4e-05 for time 1, id_amount 2 this amount prod time diff : 1e-05'}] 0 [] elapsed_time : load_data_split_time_score 2.384185791015625e-06 elapsed_time : order_list_meta_photo_and_scores 6.9141387939453125e-06 ??????????? elapsed_time : fill_and_build_computed_from_old_data 0.000629425048828125 INSERT INTO `MTRPhoto`.`dashboard_entry_day` (`dashboard_place_id`, `mtr_portfolio_id`, `date`) VALUES ( 10, 21772390, '2025-03-27' ) ON DUPLICATE KEY UPDATE updated_at=NOW(); INSERT INTO `MTRPhoto`.`dashboard_run_ids` (`dashboard_entry_day`, `mtr_user_id`, `misc_info`) VALUES (1692045,979,"{}"); elapsed_time : insert_dashboard_record_day_entry 0.027254581451416016 We will return after consolidate but for now we need the day, how to get it, for now depending on the previous heavy steps SELECT dri.dashboard_entry_day, dr.dashboard_run_id, dr.mtr_portfolio_id, dr.id, dr.hashtag, dr.completion_json FROM MTRPhoto.dashboard_results dr, MTRPhoto.dashboard_run_ids dri, MTRPhoto.dashboard_entry_day ded WHERE ded.id= 1692045 AND ded.last_run_id=dri.id AND dri.dashboard_entry_day=ded.id AND dri.id=dr.dashboard_run_id [{'dashboat_entry_day': 1692045, 'dashboard_run_id': 1700438, 'mtr_portfolio_id': 21770821, 'dashboard_result_id': 9666041, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21770821_27-03-2025_05_49_07.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21770822, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21770823, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21770824, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21770825, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21770826, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21770827, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21770828, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21770829, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21770830, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21770831, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21770832, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21770833, 'pht': 3726}}"}, {'dashboat_entry_day': 1692045, 'dashboard_run_id': 1700438, 'mtr_portfolio_id': 21771188, 'dashboard_result_id': 9666043, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771188_27-03-2025_06_05_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771334, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771335, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771336, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771337, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771338, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771339, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771340, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771341, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771342, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771343, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771344, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771345, 'pht': 3726}}"}, {'dashboat_entry_day': 1692045, 'dashboard_run_id': 1700438, 'mtr_portfolio_id': 21771757, 'dashboard_result_id': 9666044, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771757_27-03-2025_06_19_01.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771760, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771761, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771762, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771763, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771764, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771765, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771766, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771767, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771768, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771769, 'pht': 3726}}"}, {'dashboat_entry_day': 1692045, 'dashboard_run_id': 1700438, 'mtr_portfolio_id': 21772390, 'dashboard_result_id': 9666047, 'hashtag': '_______JRM', 'completion_json': "{'max_time_prod_two_photos': 0}"}] SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 21770821 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2695939, 'mtr_portfolio_id': 21770821, 'created_at': datetime.datetime(2025, 3, 27, 5, 49, 6), 'result': '0.04731234534946021', 'result_long': None, 'result_double': None}] Qualite : 0.04731234534946021 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 21770821 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21770821_27-03-2025_05_49_07.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 21770821 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21770821_27-03-2025_05_49_07.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21770822, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21770823, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21770824, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21770825, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21770826, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21770827, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21770828, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21770829, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21770830, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21770831, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21770832, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21770833, 'pht': 3726}}" where mtr_portfolio_id = 21770821 and dashboard_run_id = 1700438 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21770821 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9666041, 0.04731234534946021, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21770821_27-03-2025_05_49_07.pdf', 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21770822, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21770823, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21770824, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21770825, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21770826, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21770827, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21770828, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21770829, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21770830, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21770831, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21770832, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21770833, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 21771188 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2695971, 'mtr_portfolio_id': 21771188, 'created_at': datetime.datetime(2025, 3, 27, 6, 4, 59), 'result': '0.03843253740533886', 'result_long': None, 'result_double': None}] Qualite : 0.03843253740533886 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 21771188 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771188_27-03-2025_06_05_00.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 21771188 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771188_27-03-2025_06_05_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771334, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771335, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771336, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771337, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771338, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771339, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771340, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771341, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771342, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771343, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771344, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771345, 'pht': 3726}}" where mtr_portfolio_id = 21771188 and dashboard_run_id = 1700438 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21771188 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9666043, 0.03843253740533886, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771188_27-03-2025_06_05_00.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771334, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771335, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771336, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771337, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771338, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771339, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771340, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771341, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771342, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771343, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771344, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771345, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 21771757 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2696017, 'mtr_portfolio_id': 21771757, 'created_at': datetime.datetime(2025, 3, 27, 6, 19, 1), 'result': '0.037858994438363554', 'result_long': None, 'result_double': None}] Qualite : 0.037858994438363554 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 21771757 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771757_27-03-2025_06_19_01.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 21771757 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771757_27-03-2025_06_19_01.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771760, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771761, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771762, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771763, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771764, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771765, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771766, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771767, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771768, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771769, 'pht': 3726}}" where mtr_portfolio_id = 21771757 and dashboard_run_id = 1700438 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21771757 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9666044, 0.037858994438363554, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21771757_27-03-2025_06_19_01.pdf', 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21771758, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21771759, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21771760, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21771761, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21771762, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21771763, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21771764, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21771765, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21771766, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21771767, 'pht': 3726}, 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21771768, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21771769, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtd_id, mtr_current_id, mtr_portfolio_id, created_at, result, result_long, result_double FROM MTRPhoto.mtr_datou_result WHERE mtr_portfolio_id = 21772390 AND result is not null and result<>"None" and result<>0.0 AND mtd_id=4302 ORDER BY id desc LIMIT 1 list_result_datou : [{'mtr_datou_id': 4302, 'mtr_datou_current_id': 2696063, 'mtr_portfolio_id': 21772390, 'created_at': datetime.datetime(2025, 3, 27, 6, 24, 3), 'result': '0.026743991658349602', 'result_long': None, 'result_double': None}] Qualite : 0.026743991658349602 select url from MTRUser.mtr_files where mtd_id = 4302 and mtr_portfolio_id = 21772390 order by file_id desc limit 1 find url: https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21772390_27-03-2025_06_24_03.pdf select completion_json, dashboard_run_id from MTRPhoto.dashboard_results where mtr_portfolio_id = 21772390 order by id desc limit 1 update MTRPhoto.dashboard_results set completion_json = "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21772390_27-03-2025_06_24_03.pdf'}" where mtr_portfolio_id = 21772390 and dashboard_run_id = 1700438 SELECT name, created_at,limit_max FROM MTRDatou.mtr_datou WHERE id=4302 SELECT mtd.id, mtdt.`type`, mtd.`param`, mtd.param_json, mtdt.nb_input, mtdt.nb_output, mtdt.prod, mtdt.is_local, mtdt.is_datou_depend, mtdt.is_photo_id_local FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_step_types mtdt WHERE mtdt.`id`=mtd.`type` AND mtd.mtd_id=4302 SELECT mtd.id, mtd.mtd_id, mdsdt.id, mdsdt.name, mdsdt.description, msid.output_or_input, msid.data_order_id, mdsdt.type FROM MTRDatou.mtr_datou_step mtd, MTRDatou.mtr_datou_steptype_io_datatypes msid, MTRDatou.mtr_datou_step_data_types mdsdt WHERE mtd.`type`=msid.`mtr_datou_step_type` AND mtd.mtd_id= 4302 AND msid.data_type=mdsdt.id SELECT mts_id_output, id_output, mts_id_input, id_input FROM MTRDatou.mtr_datou_step_by_step WHERE mtd_id=4302 # VR 17-11-17 : to create in DB ! Here we check the datou graph and we reorder steps ! Tree builded and cycle checked, now we need to re-order the steps ! We have currenlty an error because there is no dependence between the last step for the case tile - detect - glue We can either keep the depence of, it is better to keep an order compatible with the id of steps if we do not have sons, so a lexical order : (number_son, step_id) All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! All sons are already in current list ! DONE and to test : checkNoCycle ! Here we check the consistency of inputs/outputs number between the given ones and the db ! eke 1-6-18 : checkConsistencyNbInputNbOutput should be processed after step reordering ! WARNING : number of outputs for step 13596 ventilate_hashtags_in_portfolio is not consistent : 2 used against 1 in the step definition ! Step 11881 final have less inputs used (1) than in the step definition (3) : maybe we manage optionnal inputs ! Step 11881 final have less outputs used (1) than in the step definition (2) : some outputs may be not used ! WARNING : number of outputs for step 13625 velours_tree is not consistent : 2 used against 1 in the step definition ! Step 11884 send_mail_cod have less inputs used (3) than in the step definition (5) : maybe we manage optionnal inputs ! Number of inputs / outputs for each step checked ! Here we check the consistency of outputs/inputs types during steps connections eke 1-6-18 : checkConsistencyTypeOutputInput should be processed after checkConsistencyNbInputNbOutput ! We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 3 of step 11884 have datatype=6 WARNING : type of output 1 of step 13596 doesn't seem to be define in the database( WARNING : type of input 3 of step 11881 doesn't seem to be define in the database( We ignore checkConsistencyTypeOutputInput for datou_step final ! WARNING : output 0 of step 13596 have datatype=10 whereas input 0 of step 13625 have datatype=18 WARNING : type of output 1 of step 13625 doesn't seem to be define in the database( WARNING : type of input 5 of step 11884 doesn't seem to be define in the database( DataTypes for each output/input checked ! no param json to modify TODO Duplicate data, are they consistent 3 ? Duplicate data, are they consistent 4 ? SELECT mptpi.id, mptpi.mtr_portfolio_id_1, mptpi.mtr_portfolio_id_2, mptpi.type, mptpi.hashtag_id, mptpi.min_score, mptpi.mtr_user_id, mptpi.created_at, mptpi.updated_at, mptpi.last_updated_at_desc, mptpi.last_updated_at_asc, h.hashtag FROM MTRPhoto.mtr_port_to_port_ids mptpi, MTRBack.hashtags h WHERE h.hashtag_id=mptpi.hashtag_id AND mptpi.`mtr_portfolio_id_1`=21772390 AND mptpi.`type`=3726 To do INSERT IGNORE INTO MTRPhoto.dashboard_results (id, qualite, completion_json) VALUES (9666047, 0.026743991658349602, "{'max_time_prod_two_photos': 0, 'url_report': 'https://storage.sbg.cloud.ovh.net/v1/AUTH_3b171620e76e4af496c5fd050759c9f0/media.fotonower.com/results_Auto_P21772390_27-03-2025_06_24_03.pdf', 'plastique': {'hashtag': 'plastique', 'sub_port_id': 21772391, 'pht': 3726}, 'mal_croppe': {'hashtag': 'mal_croppe', 'sub_port_id': 21772392, 'pht': 3726}, 'papier': {'hashtag': 'papier', 'sub_port_id': 21772393, 'pht': 3726}, 'Teint_Dans_La_Masse': {'hashtag': 'Teint_Dans_La_Masse', 'sub_port_id': 21772394, 'pht': 3726}, 'cartonnette': {'hashtag': 'cartonnette', 'sub_port_id': 21772395, 'pht': 3726}, 'autre_refus': {'hashtag': 'autre_refus', 'sub_port_id': 21772396, 'pht': 3726}, 'kraft': {'hashtag': 'kraft', 'sub_port_id': 21772397, 'pht': 3726}, 'metal': {'hashtag': 'metal', 'sub_port_id': 21772398, 'pht': 3726}, 'flou': {'hashtag': 'flou', 'sub_port_id': 21772399, 'pht': 3726}, 'Carton_brun': {'hashtag': 'Carton_brun', 'sub_port_id': 21772400, 'pht': 3726}, 'environnement': {'hashtag': 'environnement', 'sub_port_id': 21772401, 'pht': 3726}, 'Carton_gris': {'hashtag': 'Carton_gris', 'sub_port_id': 21772402, 'pht': 3726}}") ON DUPLICATE KEY UPDATE qualite=VALUES(qualite), completion_json=VALUES(completion_json) ret update_qualite_results : None SELECT mtr_photo_id FROM MTRUser.mtr_portfolio_photos WHERE mtr_portfolio_id IN (21770821,21771188,21771757,21772390) result : ((1347755548,), (1347755562,), (1347755569,), (1347755572,), (1347755623,), (1347755655,), (1347755687,), (1347755691,), (1347755697,), (1347755701,), (1347755753,), (1347755801,), (1347755884,), (1347755885,), (1347755888,), (1347755892,), (1347755925,), (1347755926,), (1347755931,), (1347755932,), (1347755937,), (1347755969,), (1347755971,), (1347755985,), (1347756014,), (1347756016,), (1347756021,), (1347756025,), (1347756028,), (1347756032,), (1347756073,), (1347756075,), (1347756079,), (1347756080,), (1347756104,), (1347756105,), (1347756108,), (1347756111,), (1347756120,), (1347756127,), (1347756205,), (1347756231,), (1347756257,), (1347756295,), (1347756599,), (1347756625,), (1347756659,), (1347756686,), (1347756709,), (1347756857,), (1347756867,), (1347756872,), (1347756894,), (1347756913,), (1347757017,), (1347757025,), (1347757362,), (1347757368,), (1347757372,), (1347757375,), (1347757377,), (1347757379,), (1347757391,), (1347757393,), (1347757396,), (1347757399,), (1347757404,), (1347757408,), (1347757435,), (1347757426,), (1347757428,), (1347757432,), (1347757485,), (1347757495,), (1347757508,), (1347757514,), (1347757524,), (1347757528,), (1347757579,), (1347757580,), (1347757585,), (1347757659,), (1347757676,), (1347757710,), (1347757712,), (1347757716,), (1347757720,), (1347757724,), (1347757744,), (1347757749,), (1347757758,), (1347757766,), (1347757768,), (1347757772,), (1347757801,), (1347757802,), (1347757816,), (1347757823,), (1347757878,), (1347757909,), (1347757935,), (1347757961,), (1347757995,), (1347758040,), (1347758254,), (1347758271,), (1347758290,), (1347758316,), (1347758345,), (1347758593,), (1347758596,), (1347758618,), (1347758621,), (1347758626,), (1347758641,), (1347758684,), (1347758706,), (1347758726,), (1347758833,), (1347758835,), (1347758930,), (1347758932,), (1347759000,), (1347759073,), (1347759082,), (1347759087,), (1347759113,), (1347759138,), (1347759149,), (1347759232,), (1347759259,), (1347759292,), (1347759319,), (1347759400,), (1347759652,), (1347760041,), (1347760073,), (1347760110,), (1347760133,), (1347760154,), (1347760209,), (1347760211,), (1347760217,), (1347760221,), (1347760230,), (1347760425,), (1347760448,), (1347760462,), (1347760485,), (1347760504,), (1347760507,), (1347760636,), (1347760672,), (1347760677,), (1347760681,), (1347760852,), (1347760860,), (1347760867,), (1347760871,), (1347760874,), (1347760891,), (1347760901,), (1347760915,), (1347760927,), (1347760930,), (1347760944,), (1347760999,), (1347761006,), (1347761020,), (1347761032,), (1347761037,), (1347761095,), (1347761104,), (1347761116,), (1347761125,), (1347761131,), (1347761141,), (1347761166,), (1347761168,), (1347761174,), (1347761178,), (1347761298,), (1347761309,), (1347761315,), (1347761322,), (1347761326,), (1347761330,), (1347761408,), (1347761412,), (1347761417,), (1347761420,), (1347761424,), (1347761538,), (1347761541,), (1347761547,), (1347761551,), (1347761680,), (1347761685,), (1347761692,), (1347761695,), (1347761698,), (1347761701,), (1347761748,), (1347761726,), (1347761728,), (1347761740,), (1347761801,), (1347761904,), (1347761967,), (1347762203,), (1347762205,), (1347762220,), (1347762345,), (1347762376,)) NUMBER BATCH : 0 # DISPLAY ALL COLLECTED DATA : {'27032025': {'nb_upload': 11, 'nb_taggue_class': 0, 'nb_taggue_densite': 0}} After datou_step_exec type output : map_portfolio_photo : len 1 keys : dict_keys([21772390]) Inside saveOutput : final : True verbose : True saveOutput not yet implemented for datou_step.type : split_time_score we use saveGeneral [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] map_info['map_portfolio_photo'] : {21772390: [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726]} final : True mtd_id 4302 list_pids : [1347762376, 1347762345, 1347762220, 1347762205, 1347762203, 1347761967, 1347761904, 1347761801, 1347761740, 1347761728, 1347761726] Looping around the photos to save general results len do output : 1 /21772390Didn't retrieve data . before output type Here is an output not treated by saveGeneral : Managing all output in save final without adding information in the mtr_datou_result ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063') ('4302', None, None, None, None, None, None, None, '2696063') ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063') begin to insert list_values into mtr_datou_result : length of list_values in save_final : 12 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, '21772390', 'None', None, None, None, None, '2696063'), ('4302', '21772390', '1347762376', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762345', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762220', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762205', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347762203', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761967', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761904', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761801', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761740', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761728', None, None, None, None, None, '2696063'), ('4302', '21772390', '1347761726', None, None, None, None, None, '2696063')] time used for this insertion : 0.017303943634033203 save_final save missing photos in datou_result : time spend for datou_step_exec : 0.34862494468688965 time spend to save output : 0.0175321102142334 total time spend for step 5 : 0.36615705490112305 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 (2696063) 2.12user 2.47system 0:10.06elapsed 45%CPU (0avgtext+0avgdata 160500maxresident)k 176inputs+5584outputs (1major+64138minor)pagefaults 0swaps