You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: complete SDK architecture and quality improvements
Major improvements for PyPI readiness:
Architecture & Standards:
- Align with Microsoft Azure SDK patterns (explicit imports only)
- Remove re-exports from all submodule __init__.py files
- Fix py2docfx documentation duplication issues
- Clean up verbose docstring additions for professional appearance
Code Quality:
- Fix deprecated datetime.utcnow() → datetime.now(timezone.utc)
- Update explicit imports: error_codes module usage consistency
- Eliminate all test warnings (pytest collection + deprecation)
- Rename test helper classes: TestClient→MockClient, TestableClient→MockableClient
Import Consistency:
- Replace 'from core import error_codes as ec' with direct imports
- Use explicit imports throughout codebase for better maintainability
- All HTTP error constants and functions imported directly
Result: Zero warnings, Microsoft-compliant architecture, PyPI-ready SDK
All tests pass, no breaking changes, professional documentation structure
Endpoint form: ``GET /{entity_set}?sql=<encoded select>``. The client extracts the logical table name, resolves the entity set (metadata cached), then issues the request. Only a constrained SELECT subset is supported by the platform.
559
570
"""
560
571
ifnotisinstance(sql, str):
561
-
raiseValidationError("sql must be a string", subcode=ec.VALIDATION_SQL_NOT_STRING)
572
+
raiseValidationError("sql must be a string", subcode=VALIDATION_SQL_NOT_STRING)
562
573
ifnotsql.strip():
563
-
raiseValidationError("sql must be a non-empty string", subcode=ec.VALIDATION_SQL_EMPTY)
574
+
raiseValidationError("sql must be a non-empty string", subcode=VALIDATION_SQL_EMPTY)
564
575
sql=sql.strip()
565
576
566
577
# Extract logical table name via helper (robust to identifiers ending with 'from')
plural_hint=" (did you pass a plural entity set name instead of the singular logical name?)"iflogical.endswith("s") andnotlogical.endswith("ss") else""
632
643
raiseMetadataError(
633
644
f"Unable to resolve entity set for logical name '{logical}'. Provide the singular logical name.{plural_hint}",
634
-
subcode=ec.METADATA_ENTITYSET_NOT_FOUND,
645
+
subcode=METADATA_ENTITYSET_NOT_FOUND,
635
646
)
636
647
md=items[0]
637
648
es=md.get("EntitySetName")
638
649
ifnotes:
639
650
raiseMetadataError(
640
651
f"Metadata response missing EntitySetName for logical '{logical}'.",
0 commit comments