def update_dataset(self, source_url_hash, s3_path=None): md = session.query(MetaTable).get(source_url_hash) if md.result_ids: ids = md.result_ids ids.append(self.request.id) else: ids = [self.request.id] with engine.begin() as c: c.execute(MetaTable.__table__.update()\ .where(MetaTable.source_url_hash == source_url_hash)\ .values(result_ids=ids)) etl = PlenarioETL(md.as_dict()) etl.update(s3_path=s3_path) return 'Finished updating {0} ({1})'.format(md.human_name, md.source_url_hash)
def update_dataset(self, source_url_hash, s3_path=None): md = session.query(MetaTable).get(source_url_hash) if md.result_ids: ids = md.result_ids ids.append(self.request.id) else: ids = [self.request.id] with engine.begin() as c: c.execute( MetaTable.__table__.update().where(MetaTable.source_url_hash == source_url_hash).values(result_ids=ids) ) etl = PlenarioETL(md.as_dict()) etl.update(s3_path=s3_path) return "Finished updating {0} ({1})".format(md.human_name, md.source_url_hash)
def update_dataset(source_url_hash, s3_path=None): md = session.query(MetaTable).get(source_url_hash) etl = PlenarioETL(md.as_dict()) etl.update(s3_path=s3_path) return 'Finished updating %s' % md.human_name