Skip to content

Commit

Permalink
Deprecate old file methods. (#599)
Browse files Browse the repository at this point in the history
Deprecates old file methods in favor of `tiledb.cloud.files` methods for version 0.12.15
  • Loading branch information
JohnMoutafis authored Jul 11, 2024
1 parent 5cecae8 commit 17df9db
Showing 1 changed file with 18 additions and 30 deletions.
48 changes: 18 additions & 30 deletions src/tiledb/cloud/file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from logging import warning
from typing import Optional, Tuple, Union

from tiledb.cloud.files import utils
from tiledb.cloud.rest_api import models


Expand All @@ -15,6 +13,9 @@ def create_file(
async_req: bool = False,
) -> models.FileCreated:
"""
DEPRECATED METHOD: Will be removed from version 0.12.16.
Use `tiledb.cloud.files.utils.create_file instead.
Creates a TileDB file at the specified location
:param namespace: namespace the create file operation belongs to
:param name: name to use for registration in TileDB Cloud
Expand All @@ -26,20 +27,9 @@ def create_file(
:param async_req: return future instead of results for async support
:return: FileCreated details, including file_uuid and output_uri
"""
warning(
DeprecationWarning(
"This method will be deprecated from version 0.12.15 onwards. "
"Use `tiledb.cloud.files.utils.create_file` instead."
),
)
utils.create_file(
namespace=namespace,
input_uri=input_uri,
output_uri=output_uri,
name=name,
access_credentials_name=access_credentials_name,
access_credential_name=access_credential_name,
async_req=async_req,
raise DeprecationWarning(
"This method is deprecated. "
"Use `tiledb.cloud.files.utils.create_file instead."
)


Expand All @@ -50,6 +40,9 @@ def export_file_local(
async_req: bool = False,
) -> models.FileExported:
"""
DEPRECATED METHOD: Will be removed from version 0.12.16.
Use `tiledb.cloud.files.utils.export_file_local` instead.
Exports a TileDB File back to its original file format
:param uri: The ``tiledb://...`` URI of the file to export
:param output_uri: output file uri
Expand All @@ -58,14 +51,9 @@ def export_file_local(
:param async_req: return future instead of results for async support
:return: FileExported details, including output_uri
"""
warning(
DeprecationWarning(
"This method will be deprecated from version 0.12.15 onwards. "
"Use `tiledb.cloud.files.utils.export_file_local` instead."
),
)
utils.export_file_local(
uri=uri, output_uri=output_uri, timestamp=timestamp, async_req=async_req
raise DeprecationWarning(
"This is deprecated. "
"Use `tiledb.cloud.files.utils.export_file_local` instead."
)


Expand All @@ -75,16 +63,16 @@ def export_file(
async_req: bool = False,
) -> models.FileExported:
"""
DEPRECATED METHOD: Will be removed from version 0.12.16.
Use `tiledb.cloud.files.utils.export_file` instead.
Exports a TileDB File back to its original file format
:param uri: The ``tiledb://...`` URI of the file to export
:param output_uri: output file uri
:param async_req: return future instead of results for async support
:return: FileExported details, including output_uri
"""
warning(
DeprecationWarning(
"This method will be deprecated from version 0.12.15 onwards. "
"Use `tiledb.cloud.files.utils.export_file` instead."
),
raise DeprecationWarning(
"This method is deprecated. "
"Use `tiledb.cloud.files.utils.export_file` instead."
)
utils.export_file(uri=uri, output_uri=output_uri, async_req=async_req)

0 comments on commit 17df9db

Please sign in to comment.