Skip to content

Commit

Permalink
fix: removed ensure_client decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-s committed Nov 26, 2024
1 parent e79b204 commit 82b3cd7
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/data_hub/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,7 @@
check_for_updates()


def ensure_client(func):
"""decorator to make sure that the client is configured"""

def wrapper(*args, **kwargs):
if "client" not in kwargs or kwargs["client"] is None:
kwargs["client"] = _api._get_default_client()
return func(*args, **kwargs)

return wrapper


@beartype
@ensure_client
def convert_id_format(
*,
hids: Optional[Union[list[str], set[str]]] = None,
Expand Down Expand Up @@ -87,7 +75,6 @@ def convert_id_format(
)


@ensure_client
@beartype
def create_workspace(
*,
Expand Down Expand Up @@ -117,7 +104,6 @@ def create_workspace(
)


@ensure_client
@beartype
def create_database(
*,
Expand Down Expand Up @@ -158,7 +144,6 @@ def create_database(


@beartype
@ensure_client
def list_files(
*,
assigned_row_ids: Optional[list[str]] = None,
Expand Down Expand Up @@ -198,7 +183,6 @@ def list_files(


@beartype
@ensure_client
def list_rows(
*,
parent_id: Optional[str] = None,
Expand Down Expand Up @@ -240,14 +224,13 @@ def list_rows(


@beartype
@ensure_client
def upload_file(
file_path: str,
*,
client=None,
_stash: bool = False,
compute_hash: bool = True,
) -> None:
):
"""Upload a file to Deep Origin.
This upload files to your Deep Origin data hub.
Expand Down Expand Up @@ -386,7 +369,6 @@ def add_database_rows(


@beartype
@ensure_client
def make_database_rows(
database_id: str,
n_rows: int = 1,
Expand Down Expand Up @@ -468,7 +450,6 @@ def assign_files_to_cell(


@beartype
@ensure_client
def upload_file_to_new_database_row(
*,
database_id: str,
Expand Down Expand Up @@ -1189,7 +1170,6 @@ def _make_deeporigin_dataframe(


@beartype
@ensure_client
def download_files(
*,
files: Optional[list[dict]] = None,
Expand Down Expand Up @@ -1590,7 +1570,6 @@ def get_row_data(
return row_data


@ensure_client
@beartype
def add_database_column(
*,
Expand Down

0 comments on commit 82b3cd7

Please sign in to comment.