feat: make pandas an optional dependency - #205
Open
Chaitanya A (ChaitanyaAIML-lab) wants to merge 2 commits into
Open
Chaitanya A (ChaitanyaAIML-lab) wants to merge 2 commits into
Chaitanya A (ChaitanyaAIML-lab) wants to merge 2 commits into
Conversation
Move pandas to optional extra [dataframe] so the core SDK can be used in lightweight environments without installing pandas. Guard imports in client, batch, and query builder namespaces, and raise an informative ImportError suggesting the [dataframe] extra when DataFrame features are accessed without pandas installed.
Chaitanya A (ChaitanyaAIML-lab)
requested a review
from a team
as a code owner
September 26, 2026 20:16
Copilot started reviewing on behalf of
Chaitanya A (ChaitanyaAIML-lab)
September 26, 2026 20:17
View session
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Unresolved review notes remain, and member assessments are mixed.
Review effort: Lite
Findings: 4
Open (4)
What changed in this PR
Moves pandas to an optional dependency while preserving core SDK functionality without it.
Changes:
- Adds the
[dataframe]optional extra and updates installation documentation. - Lazily initializes synchronous and asynchronous DataFrame operations.
- Adds informative missing-pandas errors and coverage for optional-dependency behavior.
Review notes:
- Nit: Update both shipped
SKILL.mdcopies with[dataframe]installation guidance. - Nit: Replace three
# noqapresence-check suppressions with explicit dynamic imports or equivalent usage.
| File | Summary |
|---|---|
tests/unit/test_optional_pandas.py |
Tests behavior with and without pandas. |
src/PowerPlatform/Dataverse/operations/dataframe.py |
Defers pandas imports and validates availability. |
src/PowerPlatform/Dataverse/operations/batch.py |
Lazily initializes batch DataFrame operations. |
src/PowerPlatform/Dataverse/models/record.py |
Handles missing pandas for DataFrame conversion. |
src/PowerPlatform/Dataverse/models/query_builder.py |
Defers pandas loading for conversion. |
src/PowerPlatform/Dataverse/client.py |
Lazily initializes sync DataFrame operations. |
src/PowerPlatform/Dataverse/aio/operations/async_dataframe.py |
Defers async pandas imports and validates availability. |
src/PowerPlatform/Dataverse/aio/operations/async_batch.py |
Lazily initializes async batch DataFrame operations. |
src/PowerPlatform/Dataverse/aio/async_client.py |
Lazily initializes async DataFrame operations. |
README.md |
Documents optional installation extras. |
pyproject.toml |
Defines optional and development pandas dependencies. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
Addressed the review feedback in commit ee13111:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Move
pandasfrom required dependencies to an optional[dataframe]extra inpyproject.toml.Core SDK surfaces (
client.tables.*,client.records.*,client.query.*,client.files.*) do not require pandas. Making pandas optional removes ~30MB from the installed footprint for container and service runtimes that only require schema and basic record operations.Fixes #199
Changes
pyproject.toml: Movepandas>=2.0.0from[project.dependencies]to[project.optional-dependencies]underdataframe = ["pandas>=2.0.0"]. Add pandas todevdependencies.client.pyandaio/async_client.py: Convertclient.dataframeto a property that initializesDataFrameOperationson access.operations/batch.pyandaio/operations/async_batch.py: Convertbatch.dataframeto a property that initializesBatchDataFrameOperationson access. Guard top-level pandas imports.operations/dataframe.pyandaio/operations/async_dataframe.py: Guard top-level pandas imports underif TYPE_CHECKING:. In__init__, raise anImportErrordirecting callers to installPowerPlatform-Dataverse-Client[dataframe]if pandas is not installed.models/query_builder.pyandmodels/record.py: Move top-level pandas import toif TYPE_CHECKING:, and raise an informativeImportErroronto_dataframe()if pandas is missing.README.md: Update installation documentation for the[dataframe]optional extra.tests/unit/test_optional_pandas.py: Add unit tests covering SDK behavior with and without pandas.Verification
tests/unit/test_optional_pandas.pyblack --checkandflake8passed with 0 errors