Skip to content

Commit 0beabbb

Browse files
authored
fix duplication (#605)
* fix duplication * 098
1 parent b1626d1 commit 0beabbb

File tree

5 files changed

+8
-112
lines changed

5 files changed

+8
-112
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Semantic Link Labs
22

33
[![PyPI version](https://badge.fury.io/py/semantic-link-labs.svg)](https://badge.fury.io/py/semantic-link-labs)
4-
[![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.9.7&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
4+
[![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.9.8&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
55
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
66
[![Downloads](https://static.pepy.tech/badge/semantic-link-labs)](https://pepy.tech/project/semantic-link-labs)
77

@@ -123,6 +123,7 @@ An even better way to ensure the semantic-link-labs library is available in your
123123
2. Select your newly created environment within the 'Environment' drop down in the navigation bar at the top of the notebook
124124

125125
## Version History
126+
* [0.9.8](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.8) (April 3, 2025)
126127
* [0.9.7](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.7) (April 1, 2025)
127128
* [0.9.6](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.6) (March 12, 2025)
128129
* [0.9.5](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.5) (March 7, 2025)

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
project = 'semantic-link-labs'
1414
copyright = '2024, Microsoft and community'
1515
author = 'Microsoft and community'
16-
release = '0.9.7'
16+
release = '0.9.8'
1717

1818
# -- General configuration ---------------------------------------------------
1919
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name="semantic-link-labs"
77
authors = [
88
{ name = "Microsoft Corporation" },
99
]
10-
version="0.9.7"
10+
version="0.9.8"
1111
description="Semantic Link Labs for Microsoft Fabric"
1212
readme="README.md"
1313
requires-python=">=3.10,<3.12"

src/sempy_labs/_helper_functions.py

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def resolve_lakehouse_name_and_id(
392392
lakehouse: Optional[str | UUID] = None, workspace: Optional[str | UUID] = None
393393
) -> Tuple[str, UUID]:
394394

395-
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
395+
workspace_id = resolve_workspace_id(workspace)
396396
type = "Lakehouse"
397397

398398
if lakehouse is None:
@@ -896,113 +896,6 @@ def resolve_workspace_name_and_id(
896896
return workspace_name, workspace_id
897897

898898

899-
def resolve_item_id(
900-
item: str | UUID, type: Optional[str] = None, workspace: Optional[str | UUID] = None
901-
) -> UUID:
902-
903-
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
904-
item_id = None
905-
906-
if _is_valid_uuid(item):
907-
# Check (optional)
908-
item_id = item
909-
try:
910-
_base_api(
911-
request=f"/v1/workspaces/{workspace_id}/items/{item_id}",
912-
client="fabric_sp",
913-
)
914-
except FabricHTTPException:
915-
raise ValueError(
916-
f"{icons.red_dot} The '{item_id}' item was not found in the '{workspace_name}' workspace."
917-
)
918-
else:
919-
if type is None:
920-
raise ValueError(
921-
f"{icons.red_dot} The 'type' parameter is required if specifying an item name."
922-
)
923-
responses = _base_api(
924-
request=f"/v1/workspaces/{workspace_id}/items?type={type}",
925-
client="fabric_sp",
926-
uses_pagination=True,
927-
)
928-
for r in responses:
929-
for v in r.get("value", []):
930-
display_name = v.get("displayName")
931-
if display_name == item:
932-
item_id = v.get("id")
933-
break
934-
935-
if item_id is None:
936-
raise ValueError(
937-
f"{icons.red_dot} There's no item '{item}' of type '{type}' in the '{workspace_name}' workspace."
938-
)
939-
940-
return item_id
941-
942-
943-
def resolve_item_name_and_id(
944-
item: str | UUID, type: Optional[str] = None, workspace: Optional[str | UUID] = None
945-
) -> Tuple[str, UUID]:
946-
947-
workspace_id = resolve_workspace_id(workspace)
948-
item_id = resolve_item_id(item=item, type=type, workspace=workspace_id)
949-
item_name = (
950-
_base_api(
951-
request=f"/v1/workspaces/{workspace_id}/items/{item_id}", client="fabric_sp"
952-
)
953-
.json()
954-
.get("displayName")
955-
)
956-
957-
return item_name, item_id
958-
959-
960-
def resolve_item_name(item_id: UUID, workspace: Optional[str | UUID] = None) -> str:
961-
962-
workspace_id = resolve_workspace_id(workspace)
963-
try:
964-
item_name = (
965-
_base_api(
966-
request=f"/v1/workspaces/{workspace_id}/items/{item_id}",
967-
client="fabric_sp",
968-
)
969-
.json()
970-
.get("displayName")
971-
)
972-
except FabricHTTPException:
973-
raise ValueError(
974-
f"{icons.red_dot} The '{item_id}' item was not found in the '{workspace_id}' workspace."
975-
)
976-
977-
return item_name
978-
979-
980-
def resolve_lakehouse_name_and_id(
981-
lakehouse: Optional[str | UUID] = None, workspace: Optional[str | UUID] = None
982-
) -> Tuple[str, UUID]:
983-
984-
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
985-
type = "Lakehouse"
986-
987-
if lakehouse is None:
988-
lakehouse_id = fabric.get_lakehouse_id()
989-
lakehouse_name = fabric.resolve_item_name(
990-
item_id=lakehouse_id, type=type, workspace=workspace_id
991-
)
992-
elif _is_valid_uuid(lakehouse):
993-
lakehouse_id = lakehouse
994-
lakehouse_name = fabric.resolve_item_name(
995-
item_id=lakehouse_id, type=type, workspace=workspace_id
996-
)
997-
else:
998-
lakehouse_name = lakehouse
999-
lakehouse_id = fabric.resolve_item_id(
1000-
item_name=lakehouse, type=type, workspace=workspace_id
1001-
)
1002-
1003-
return lakehouse_name, lakehouse_id
1004-
1005-
1006899
def _extract_json(dataframe: pd.DataFrame) -> dict:
1007900

1008901
payload = dataframe["payload"].iloc[0]

src/sempy_labs/tom/_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5065,7 +5065,9 @@ def _generate_m_expression(
50655065
# Remove the Direct Lake partition
50665066
self.remove_object(object=p)
50675067

5068-
print(f"{icons.green_dot} The '{table_name}' table has been converted to Import mode.")
5068+
print(
5069+
f"{icons.green_dot} The '{table_name}' table has been converted to Import mode."
5070+
)
50695071

50705072
def close(self):
50715073

0 commit comments

Comments
 (0)