-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from mrjsj/chore/prepare-release
chore: updated docs, prepare for release 0.2.0
- Loading branch information
Showing
9 changed files
with
163 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
from msfabricutils.fabric_duckdb_connection import FabricDuckDBConnection | ||
from msfabricutils.core import ( | ||
get_fabric_bearer_token, | ||
get_onelake_access_token, | ||
get_workspace, | ||
get_workspace_lakehouse_tables, | ||
get_workspace_lakehouses, | ||
get_workspaces, | ||
) | ||
|
||
__all__ = ( | ||
"FabricDuckDBConnection", | ||
"get_fabric_bearer_token", | ||
"get_onelake_access_token", | ||
"get_workspace", | ||
"get_workspace_lakehouse_tables", | ||
"get_workspace_lakehouses", | ||
"get_workspaces", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,42 @@ | ||
from msfabricutils.core.generic import get_paginated, get_page | ||
|
||
|
||
def get_workspaces(): | ||
def get_workspaces() -> list[dict]: | ||
""" | ||
Retrieves a list of workspaces. | ||
This function fetches a list of workspaces using the `get_paginated` function. | ||
It constructs the appropriate endpoint and retrieves the paginated data associated | ||
with workspaces. | ||
Returns: | ||
list[dict]: A list of dictionaries containing data for the available workspaces. | ||
See Also: | ||
`get_paginated`: A helper function that handles paginated API requests. | ||
""" | ||
endpoint = "workspaces" | ||
data_key = "value" | ||
|
||
return get_paginated(endpoint, data_key) | ||
|
||
|
||
def get_workspace(workspace_id: str): | ||
def get_workspace(workspace_id: str) -> dict: | ||
""" | ||
Retrieves details of a specified workspace. | ||
This function fetches the details of a specific workspace by using the `get_page` | ||
function. It constructs the appropriate endpoint based on the provided workspace ID. | ||
Args: | ||
workspace_id (str): The ID of the workspace to retrieve details for. | ||
Returns: | ||
dict: A dictionary containing the details of the specified workspace. | ||
See Also: | ||
`get_page`: A helper function that retrieves a single page of data from the API. | ||
""" | ||
endpoint = f"workspaces/{workspace_id}" | ||
|
||
return get_page(endpoint) |