def test_gcsfs_ingest_view_export_args(self) -> None: dt_lower = datetime.datetime(2019, 1, 22, 11, 22, 33, 444444) dt_upper = datetime.datetime(2019, 11, 22, 11, 22, 33, 444444) args = GcsfsIngestViewExportArgs( ingest_view_name="my_file_tag", upper_bound_datetime_prev=None, upper_bound_datetime_to_export=dt_upper, ) self.assertEqual( "ingest_view_export_my_file_tag-None-2019_11_22_11_22_33_444444", args.task_id_tag(), ) args = GcsfsIngestViewExportArgs( ingest_view_name="my_file_tag", upper_bound_datetime_prev=dt_lower, upper_bound_datetime_to_export=dt_upper, ) self.assertEqual( "ingest_view_export_my_file_tag-2019_01_22_11_22_33_444444-2019_11_22_11_22_33_444444", args.task_id_tag(), )
def create_direct_ingest_ingest_view_export_task( self, region: Region, ingest_instance: DirectIngestInstance, ingest_view_export_args: GcsfsIngestViewExportArgs, ) -> None: task_id = _build_task_id( region.region_code, ingest_instance, task_id_tag=ingest_view_export_args.task_id_tag(), prefix_only=False, ) params = { "region": region.region_code.lower(), "output_bucket": ingest_view_export_args.output_bucket_name, } relative_uri = f"/direct/ingest_view_export?{urlencode(params)}" body = self._get_body_from_args(ingest_view_export_args) self._get_bq_import_export_queue_manager(region, ingest_instance).create_task( task_id=task_id, relative_uri=relative_uri, body=body, )
def create_direct_ingest_ingest_view_export_task( self, region: Region, ingest_view_export_args: GcsfsIngestViewExportArgs) -> None: task_id = _build_task_id( region.region_code, task_id_tag=ingest_view_export_args.task_id_tag(), prefix_only=False, ) relative_uri = f"/direct/ingest_view_export?region={region.region_code}" body = self._get_body_from_args(ingest_view_export_args) self.bq_import_export_cloud_task_queue_manager.create_task( task_id=task_id, relative_uri=relative_uri, body=body, )
def create_direct_ingest_ingest_view_export_task( self, region: Region, ingest_view_export_args: GcsfsIngestViewExportArgs): task_id = _build_task_id( region.region_code, task_id_tag=ingest_view_export_args.task_id_tag(), prefix_only=False) relative_uri = f'/direct/ingest_view_export?region={region.region_code}' body = self._get_body_from_args(ingest_view_export_args) self.cloud_task_client.create_task( task_id=task_id, queue_name=DIRECT_INGEST_BQ_IMPORT_EXPORT_QUEUE_V2, relative_uri=relative_uri, body=body, )