Skip to content

Move deprecated models to dedicated subdirectory and add dynamic handling#96

Merged
rhythmatician merged 11 commits intomasterfrom
fix-unused-deprecation-warnings
Feb 12, 2026
Merged

Move deprecated models to dedicated subdirectory and add dynamic handling#96
rhythmatician merged 11 commits intomasterfrom
fix-unused-deprecation-warnings

Conversation

@rhythmatician
Copy link
Collaborator

Introduce a new module for managing deprecated symbols, enabling runtime warnings for deprecated usage. Streamline imports and update attribute types in the MeasurementsToUpdateMeasurementSetResponseModel. Add tests for non-deprecated models in package exports.

…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.
Copilot AI review requested due to automatic review settings February 7, 2026 04:08
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

This PR restructures qualer_sdk.models by moving deprecated model symbols into a dedicated models/deprecated/ package and switching the top-level qualer_sdk.models module to a dynamic, discovery-based export mechanism with runtime deprecation handling.

Changes:

  • Replaced the large static export list in qualer_sdk.models.__init__ with lazy, regex-based discovery and __getattr__ loading.
  • Added a qualer_sdk.models.deprecated package that discovers deprecated symbols and resolves them dynamically.
  • Updated MeasurementsToUpdateMeasurementSetResponseModel typing/imports and added a unit test intended to validate package exports for non-deprecated models.

Reviewed changes

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

Show a summary per file
File Description
tests/unit/test_models_package_exports.py Adds a unit test to assert non-deprecated model classes are accessible as qualer_sdk.models attributes.
src/qualer_sdk/models/init.py Implements dynamic discovery of model symbols and lazy loading via __getattr__.
src/qualer_sdk/models/qualer_api_models_measurements_to_update_measurement_set_response_model.py Updates field types/imports and refactors some serialization logic.
src/qualer_sdk/models/deprecated/init.py Adds deprecated symbol discovery and dynamic attribute resolution for deprecated names.
src/qualer_sdk/models/deprecated/qualer_api_models_service_orders_to_provider_service_order_response_model_order_status.py Deprecated alias wrapper for ServiceOrdersToProviderServiceOrderResponseModelOrderStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_service_orders_from_order_item_update_model_as_left_check.py Deprecated alias wrapper for ServiceOrdersFromOrderItemUpdateModelAsLeftCheck.
src/qualer_sdk/models/deprecated/qualer_api_models_service_orders_from_order_item_update_model_as_found_check.py Deprecated alias wrapper for ServiceOrdersFromOrderItemUpdateModelAsFoundCheck.
src/qualer_sdk/models/deprecated/qualer_api_models_service_order_documents_to_company_order_item_controlled_document_response.py Deprecated alias wrapper for ServiceOrderDocumentsToCompanyOrderItemControlledDocumentResponse.
src/qualer_sdk/models/deprecated/qualer_api_models_service_order_documents_to_company_order_controlled_document_response.py Deprecated alias wrapper for ServiceOrderDocumentsToCompanyOrderControlledDocumentResponse.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_reading_entry_math.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseReadingEntryMath.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_precision_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponsePrecisionType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_measurement_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseMeasurementType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_measurement_not_taken_result.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseMeasurementNotTakenResult.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_hysteresis_point.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseHysteresisPoint.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_guard_band_logic.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseGuardBandLogic.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_response_environment_mask.py Deprecated alias wrapper for ReportDatasetsToMeasurementResponseEnvironmentMask.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_left_reading_entry_math.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsLeftReadingEntryMath.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_left_precision_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsLeftPrecisionType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_left_measurement_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsLeftMeasurementType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_left_measurement_not_taken_result.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsLeftMeasurementNotTakenResult.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_left_guard_band_logic.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsLeftGuardBandLogic.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_found_reading_entry_math.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsFoundReadingEntryMath.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_found_precision_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsFoundPrecisionType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_found_measurement_type.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsFoundMeasurementType.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_found_measurement_not_taken_result.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsFoundMeasurementNotTakenResult.
src/qualer_sdk/models/deprecated/qualer_api_models_report_datasets_to_measurement_all_response_as_found_guard_band_logic.py Deprecated alias wrapper for ReportDatasetsToMeasurementAllResponseAsFoundGuardBandLogic.
src/qualer_sdk/models/deprecated/qualer_api_models_measurements_to_update_measurement_set_response_model_influence_parameter_2_type.py Deprecated alias wrapper for MeasurementsToUpdateMeasurementSetResponseModelInfluenceParameter2Type.
src/qualer_sdk/models/deprecated/qualer_api_models_measurements_to_update_measurement_set_response_model_influence_parameter_1_type.py Deprecated alias wrapper for MeasurementsToUpdateMeasurementSetResponseModelInfluenceParameter1Type.
src/qualer_sdk/models/deprecated/qualer_api_models_measurements_from_update_measurement_set_model_influence_parameter_2_type.py Deprecated alias wrapper for MeasurementsFromUpdateMeasurementSetModelInfluenceParameter2Type.
src/qualer_sdk/models/deprecated/qualer_api_models_measurements_from_update_measurement_set_model_influence_parameter_1_type.py Deprecated alias wrapper for MeasurementsFromUpdateMeasurementSetModelInfluenceParameter1Type.
src/qualer_sdk/models/deprecated/qualer_api_models_measurements_from_update_measurement_point_model_hysteresis_point.py Deprecated alias wrapper for MeasurementsFromUpdateMeasurementPointModelHysteresisPoint.
src/qualer_sdk/models/deprecated/qualer_api_models_environment_to_environment_model_factor_id.py Deprecated alias wrapper for EnvironmentToEnvironmentModelFactorId.
src/qualer_sdk/models/deprecated/qualer_api_models_environment_from_environment_model_factor_id.py Deprecated alias wrapper for EnvironmentFromEnvironmentModelFactorId.
src/qualer_sdk/models/deprecated/qualer_api_models_clients_from_sponsored_client_edit_model_client_status.py Deprecated alias wrapper for ClientsFromSponsoredClientEditModelClientStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_clients_from_sponsored_client_create_model_client_status.py Deprecated alias wrapper for ClientsFromSponsoredClientCreateModelClientStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_clients_from_asset_model_asset_status.py Deprecated alias wrapper for ClientsFromAssetModelAssetStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_asset_to_client_asset_manager_response_model_record_type.py Deprecated wrapper for AssetToClientAssetManagerResponseModelRecordType (dynamic warn-on-attr).
src/qualer_sdk/models/deprecated/qualer_api_models_asset_to_asset_response_model_asset_status.py Deprecated alias wrapper for AssetToAssetResponseModelAssetStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_asset_to_asset_manage_response_model_record_type.py Deprecated wrapper for AssetToAssetManageResponseModelRecordType (dynamic warn-on-attr).
src/qualer_sdk/models/deprecated/qualer_api_models_asset_to_asset_maintenance_plan_model_asset_status.py Deprecated alias wrapper for AssetToAssetMaintenancePlanModelAssetStatus.
src/qualer_sdk/models/deprecated/qualer_api_models_asset_to_asset_forecast_api_response_model_asset_status.py Deprecated alias wrapper for AssetToAssetForecastApiResponseModelAssetStatus.
src/qualer_sdk/models/deprecated/get_get_4_element_page.py Deprecated alias wrapper for GetGet4ElementPage.
src/qualer_sdk/models/deprecated/delete_element_page.py Deprecated alias wrapper for DeleteElementPage.
Comments suppressed due to low confidence (2)

src/qualer_sdk/models/qualer_api_models_measurements_to_update_measurement_set_response_model.py:29

  • The docstring and type annotations were changed to make measurement_set_id/measurement_name/is_accredited non-Optional, but the rest of the model still treats them as nullable (e.g., to_dict conditionally includes them). Either keep these fields Optional with defaults, or enforce required behavior consistently (always serialize them and validate/raise in from_dict when missing).
    src/qualer_sdk/models/qualer_api_models_measurements_to_update_measurement_set_response_model.py:143
  • from_dict still defaults required fields to None (e.g., d.pop("MeasurementSetId", None)) and then passes them into the constructor, which contradicts the new non-Optional type hints and can propagate None values at runtime. If these fields are required, pop without a default (or raise on None) and/or add explicit validation.

@rhythmatician
Copy link
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 7, 2026

@rhythmatician I've opened a new pull request, #97, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 7, 2026 00:54
…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>
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

Copilot reviewed 21 out of 61 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/qualer_sdk/models/qualer_api_models_measurements_to_update_measurement_set_response_model.py:103

  • measurement_set_id, measurement_name, and is_accredited were changed to non-Optional/required fields, but from_dict() still pops them with a default of None and to_dict() still conditionally omits them when they are None. This creates a type/behavior mismatch and allows constructing instances with None in required fields. Either revert these back to Optional with defaults, or make parsing/serialization enforce presence (pop without default + raise, and always include in to_dict).

@rhythmatician
Copy link
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 12, 2026

@rhythmatician I've opened a new pull request, #98, to work on those changes. Once the pull request is ready, I'll request review from you.

@rhythmatician rhythmatician merged commit 4bae950 into master Feb 12, 2026
8 checks passed
@rhythmatician rhythmatician deleted the fix-unused-deprecation-warnings branch February 12, 2026 03:23
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