Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hdx.py #5

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions API/hdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ async def create_hdx(
request: Request, hdx_data: dict, user_data: AuthUser = Depends(staff_required)
):
"""
Create a new HDX entry.
Creates a new HDX entry.

Args:
request (Request): The request object.
hdx_data (dict): Data for creating the HDX entry.
user_data (AuthUser): User authentication data.

Returns:
dict: Result of the HDX creation process.
dict: A dictionary containing information about the newly created HDX entry.
"""
hdx_instance = HDX()
return hdx_instance.create_hdx(hdx_data)
Expand All @@ -49,11 +49,13 @@ async def read_hdx_list(

Args:
request (Request): The request object.
skip (int): Number of entries to skip.
limit (int): Maximum number of entries to retrieve.
skip (int): Number of entries to skip. Defaults to 0.
limit (int): Maximum number of entries to retrieve. Defaults to 10.

Returns:
List[dict]: List of HDX entries.
Raises:
HTTPException: If there is an error retrieving the HDX list
"""
hdx_instance = HDX()
filters = {}
Expand Down Expand Up @@ -87,8 +89,8 @@ async def search_hdx(
Args:
request (Request): The request object.
dataset_title (str): The title of the dataset to search for.
skip (int): Number of entries to skip.
limit (int): Maximum number of entries to retrieve.
skip (int): Number of entries to skip. Defaults 0.
limit (int): Maximum number of entries to retrieve. Defaults to 0.

Returns:
List[dict]: List of HDX entries matching the dataset title.
Expand Down