Skip to content

Commit ee13111

Browse files
fix(dataframe): use dynamic import for presence check and update skill docs
1 parent 2d2e827 commit ee13111

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎.claude/skills/dataverse-sdk-use/SKILL.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ client.records.delete("account", [id1, id2, id3], use_bulk_delete=True)
253253

254254
### DataFrame Operations
255255

256-
The SDK provides DataFrame wrappers for all CRUD operations via the `client.dataframe` namespace, using pandas DataFrames and Series as input/output.
256+
The SDK provides DataFrame wrappers for all CRUD operations via the `client.dataframe` namespace, using pandas DataFrames and Series as input/output. Requires the `[dataframe]` extra: `pip install "PowerPlatform-Dataverse-Client[dataframe]"`.
257257

258258
> **Note:** `client.dataframe.get()` is deprecated. Use `client.query.builder(table).select(...).where(...).execute().to_dataframe()` instead. `QueryBuilder.to_dataframe()` (without `.execute()`) is also deprecated — always call `.execute()` first.
259259
@@ -686,6 +686,8 @@ result = await batch.execute()
686686
```
687687

688688
### DataFrame Operations
689+
690+
Requires the `[dataframe]` extra: `pip install "PowerPlatform-Dataverse-Client[dataframe]"`.
689691
```python
690692
# given: client is an open AsyncDataverseClient
691693
import pandas as pd

‎src/PowerPlatform/Dataverse/aio/operations/async_dataframe.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ class AsyncDataFrameOperations:
4949

5050
def __init__(self, client: "AsyncDataverseClient") -> None:
5151
try:
52-
import pandas as pd # noqa: F401
52+
import importlib
53+
54+
importlib.import_module("pandas")
5355
except ImportError as exc:
5456
raise ImportError(
5557
"pandas is required to use DataFrame features. "

‎src/PowerPlatform/Dataverse/claude_skill/dataverse-sdk-use/SKILL.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ client.records.delete("account", [id1, id2, id3], use_bulk_delete=True)
253253

254254
### DataFrame Operations
255255

256-
The SDK provides DataFrame wrappers for all CRUD operations via the `client.dataframe` namespace, using pandas DataFrames and Series as input/output.
256+
The SDK provides DataFrame wrappers for all CRUD operations via the `client.dataframe` namespace, using pandas DataFrames and Series as input/output. Requires the `[dataframe]` extra: `pip install "PowerPlatform-Dataverse-Client[dataframe]"`.
257257

258258
> **Note:** `client.dataframe.get()` is deprecated. Use `client.query.builder(table).select(...).where(...).execute().to_dataframe()` instead. `QueryBuilder.to_dataframe()` (without `.execute()`) is also deprecated — always call `.execute()` first.
259259
@@ -686,6 +686,8 @@ result = await batch.execute()
686686
```
687687

688688
### DataFrame Operations
689+
690+
Requires the `[dataframe]` extra: `pip install "PowerPlatform-Dataverse-Client[dataframe]"`.
689691
```python
690692
# given: client is an open AsyncDataverseClient
691693
import pandas as pd

‎src/PowerPlatform/Dataverse/operations/batch.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@ class BatchDataFrameOperations:
800800

801801
def __init__(self, batch: "_BatchContext") -> None:
802802
try:
803-
import pandas as pd # noqa: F401
803+
import importlib
804+
805+
importlib.import_module("pandas")
804806
except ImportError as exc:
805807
raise ImportError(
806808
"pandas is required to use DataFrame features. "

‎src/PowerPlatform/Dataverse/operations/dataframe.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class DataFrameOperations:
4848

4949
def __init__(self, client: DataverseClient) -> None:
5050
try:
51-
import pandas as pd # noqa: F401
51+
import importlib
52+
53+
importlib.import_module("pandas")
5254
except ImportError as exc:
5355
raise ImportError(
5456
"pandas is required to use DataFrame features. "

0 commit comments

Comments
 (0)