Skip to content

Fix alias detection, docstring references, and GUID validation#98

Merged
rhythmatician merged 15 commits intomasterfrom
copilot/sub-pr-96
Feb 12, 2026
Merged

Fix alias detection, docstring references, and GUID validation#98
rhythmatician merged 15 commits intomasterfrom
copilot/sub-pr-96

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Addresses four issues from PR review feedback: TypeVar pollution in package exports, stale deprecated type references in docstrings, unused imports, and permissive GUID parsing.

Changes

  • Tightened alias detection regex in models/__init__.py to match only Name = OtherName patterns, excluding T = TypeVar(...) and function calls. Prevents internal TypeVars from being exported via __all__.

  • Updated MeasurementsToUpdateMeasurementSetResponseModel docstring to reference InfluenceParameterType instead of deprecated MeasurementsToUpdateMeasurementSetResponseModelInfluenceParameter1Type/2Type.

  • Removed unused warnings import and replacement variable in deprecated/__init__.py.

  • Fixed _parse_guid() in AssetServiceRecordsToAssetServiceRecordResponseModel to return None on parse failure instead of casting invalid input, enabling proper validation rejection of malformed GUIDs.

Example

Before the regex fix:

from qualer_sdk.models import T  # TypeVar leaked into public API

After:

from qualer_sdk.models import T  # AttributeError: no attribute 'T'
from qualer_sdk.models import AssetToAssetManageResponseModelDueStatus  # Valid alias still works

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

rhythmatician and others added 12 commits February 6, 2026 19:59
…bols

- Introduced a new module to manage deprecated symbols within the SDK.
- Implemented a mechanism to discover and warn about deprecated symbols at runtime.
- Added regex-based parsing to identify deprecated messages in module files.
- Enhanced the `__getattr__` and `__dir__` methods to support dynamic loading of deprecated symbols.
…warnings (#97)

* Initial plan

* Fix deprecated module imports in non-deprecated model files

Updated 12 model files to import from non-deprecated modules instead of
deprecated ones. All imports now use aliased imports to maintain backward
compatibility while using the correct source modules.

Files fixed:
- Asset forecast, maintenance plan, and response models
- Client asset and sponsored client models
- Environment models
- Measurement set models
- Report dataset measurement models
- Service order models

Co-authored-by: rhythmatician <75549255+rhythmatician@users.noreply.github.com>

* chore: remove trailing whitespace

Co-authored-by: rhythmatician <75549255+rhythmatician@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rhythmatician <75549255+rhythmatician@users.noreply.github.com>
…ighten alias regex, fix GUID parsing

Co-authored-by: rhythmatician <75549255+rhythmatician@users.noreply.github.com>
Copilot AI changed the title [WIP] Move deprecated models to dedicated subdirectory and add dynamic handling Fix alias detection, docstring references, and GUID validation Feb 12, 2026
Copilot AI requested a review from rhythmatician February 12, 2026 02:21
Base automatically changed from fix-unused-deprecation-warnings to master February 12, 2026 03:23
@rhythmatician rhythmatician marked this pull request as ready for review February 12, 2026 04:45
Copilot AI review requested due to automatic review settings February 12, 2026 04:45
@rhythmatician rhythmatician enabled auto-merge (squash) February 12, 2026 04:45
@rhythmatician rhythmatician merged commit 20c8fa0 into master Feb 12, 2026
12 checks passed
@rhythmatician rhythmatician deleted the copilot/sub-pr-96 branch February 12, 2026 04:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes several API-surface and validation issues: prevent unintended TypeVar exports, refresh stale docstring type references, remove unused imports, and tighten GUID parsing behavior.

Changes:

  • Tightened alias detection regex in models/__init__.py to only export Name = OtherName aliases.
  • Updated MeasurementsToUpdateMeasurementSetResponseModel docstring to reference InfluenceParameterType.
  • Removed unused import(s) in deprecated model package init.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/qualer_sdk/models/init.py Narrows alias detection so only valid class-to-class aliases contribute to __all__.
src/qualer_sdk/models/qualer_api_models_measurements_to_update_measurement_set_response_model.py Updates docstring type references to the current InfluenceParameterType.
src/qualer_sdk/models/deprecated/init.py Removes an unused warnings import to reduce clutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants