From 93d097ff4ba6f76206281d57b83d96f7a56b7a8a Mon Sep 17 00:00:00 2001 From: Nate Schmitz Date: Thu, 31 Oct 2024 15:55:46 -0700 Subject: [PATCH] Un-launch `ee.data.startExternalImageIngestion` and `external_image`. We'd like to add some documentation before making this new functionality public. PiperOrigin-RevId: 691962779 --- python/ee/cli/commands.py | 16 ---------------- python/ee/data.py | 38 -------------------------------------- 2 files changed, 54 deletions(-) diff --git a/python/ee/cli/commands.py b/python/ee/cli/commands.py index d89c0497d..faab4f627 100644 --- a/python/ee/cli/commands.py +++ b/python/ee/cli/commands.py @@ -1447,21 +1447,6 @@ def is_tf_record(path: str) -> bool: return manifest - -class UploadExternalImageCommand(UploadImageCommand): - name = 'external_image' - - @_using_v1alpha - def run( - self, args: argparse.Namespace, config: utils.CommandLineConfig - ) -> None: - """Creates an external image synchronously.""" - config.ee_init() - manifest = self.manifest_from_args(args) - name = ee.data.startExternalImageIngestion(manifest, args.force)['name'] - print('Created asset %s' % name) - - # TODO(user): update src_files help string when secondary files # can be uploaded. class UploadTableCommand: @@ -1651,7 +1636,6 @@ class UploadCommand(Dispatcher): COMMANDS = [ UploadImageCommand, - UploadExternalImageCommand, UploadTableCommand, ] diff --git a/python/ee/data.py b/python/ee/data.py index 620791a51..91a474679 100644 --- a/python/ee/data.py +++ b/python/ee/data.py @@ -1910,7 +1910,6 @@ def _prepare_and_run_export( # TODO(user): use StrEnum when 3.11 is the min version _INTERNAL_IMPORT = 'INTERNAL_IMPORT' -_EXTERNAL_IMPORT = 'EXTERNAL_IMPORT' def _startIngestion( @@ -1934,10 +1933,6 @@ def _startIngestion( image = _get_cloud_projects().image() if import_mode == _INTERNAL_IMPORT: import_request = image.import_(project=_get_projects_path(), body=request) - elif import_mode == _EXTERNAL_IMPORT: - import_request = image.importExternal( - project=_get_projects_path(), body=request - ) else: raise ee_exception.EEException( '{} is not a valid import mode'.format(import_mode) @@ -1997,39 +1992,6 @@ def startIngestion( """ return _startIngestion(request_id, params, allow_overwrite, _INTERNAL_IMPORT) - -def startExternalImageIngestion( - image_manifest: Dict[str, Any], - allow_overwrite: bool = False, -) -> Dict[str, Any]: - """Creates an external image. - - Args: - image_manifest: The object that describes the import task, which can - have these fields: - name (string) The destination asset id (e.g., - "projects/myproject/assets/foo/bar"). - tilesets (array) A list of Google Cloud Storage source file paths - formatted like: - [{'sources': [ - {'uris': ['foo.tif', 'foo.prj']}, - {'uris': ['bar.tif', 'bar.prj']}, - ]}] - Where path values correspond to source files' Google Cloud Storage - object names, e.g., 'gs://bucketname/filename.tif' - bands (array) An optional list of band names formatted like: - [{'id': 'R'}, {'id': 'G'}, {'id': 'B'}] - In general, this is a dict representation of an ImageManifest. - allow_overwrite: Whether the ingested image can overwrite an - existing version. - - Returns: - The name of the created asset. - """ - return _startIngestion( - 'unused', image_manifest, allow_overwrite, _EXTERNAL_IMPORT) - - def startTableIngestion( request_id: str, params: Dict[str, Any], allow_overwrite: bool = False ) -> Dict[str, Any]: