Skip to content

Commit b153d65

Browse files
committed
refactor: align SDK architecture with Microsoft standards
- Remove re-exports from all submodule __init__.py files (core, data, utils) - Eliminates py2docfx documentation duplication issues - Matches Azure SDK for Python patterns (explicit imports only) - Keeps implementation details private and encourages proper imports - All tests pass, zero breaking changes to existing code This follows Microsoft's own SDK design patterns where: - Main package exports only the primary client - Submodules require explicit imports from specific modules - No convenience re-exports that create duplicate API surface
1 parent b71f6a6 commit b153d65

File tree

3 files changed

+19
-29
lines changed

3 files changed

+19
-29
lines changed

src/PowerPlatform/Dataverse/core/__init__.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,13 @@
66
77
This module contains the foundational components including authentication,
88
configuration, HTTP client, and error handling.
9-
"""
109
11-
from .auth import AuthManager, TokenPair
12-
from .config import DataverseConfig
13-
from .errors import (
14-
DataverseError,
15-
HttpError,
16-
ValidationError,
17-
MetadataError,
18-
SQLParseError,
19-
)
20-
from .http import HttpClient
10+
Import classes directly from their specific modules:
11+
- Authentication: from .auth import AuthManager, TokenPair
12+
- Configuration: from .config import DataverseConfig
13+
- Errors: from .errors import DataverseError, HttpError, etc.
14+
- HTTP Client: from .http import HttpClient
15+
"""
2116

22-
__all__ = [
23-
"AuthManager",
24-
"TokenPair",
25-
"DataverseConfig",
26-
"DataverseError",
27-
"HttpError",
28-
"ValidationError",
29-
"MetadataError",
30-
"SQLParseError",
31-
"HttpClient",
32-
]
17+
# No re-exports to avoid documentation duplication with py2docfx
18+
__all__ = []

src/PowerPlatform/Dataverse/data/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
77
This module contains OData protocol handling, CRUD operations, metadata management,
88
SQL query functionality, and file upload capabilities.
9-
"""
109
11-
from .odata import ODataClient
12-
from .upload import ODataFileUpload
10+
Import classes directly from their specific modules:
11+
- OData operations: from .odata import ODataClient
12+
- File uploads: from .upload import ODataFileUpload
13+
"""
1314

14-
__all__ = ["ODataClient", "ODataFileUpload"]
15+
# No re-exports to avoid documentation duplication with py2docfx
16+
__all__ = []

src/PowerPlatform/Dataverse/utils/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
77
This module contains helper functions, adapters (like Pandas integration),
88
logging utilities, and validation helpers.
9-
"""
109
11-
from .pandas_adapter import PandasODataClient
10+
Import classes directly from their specific modules:
11+
- Pandas integration: from .pandas_adapter import PandasODataClient
12+
"""
1213

13-
__all__ = ["PandasODataClient"]
14+
# No re-exports to avoid documentation duplication with py2docfx
15+
__all__ = []

0 commit comments

Comments
 (0)