Skip to content

Enhance Qualer SDK with new features and fixes#21

Merged
rhythmatician merged 13 commits intomasterfrom
test-and-validate-spec
Jul 1, 2025
Merged

Enhance Qualer SDK with new features and fixes#21
rhythmatician merged 13 commits intomasterfrom
test-and-validate-spec

Conversation

@rhythmatician
Copy link
Collaborator

Introduce parameterized integration tests for various SDK endpoints, improve handling of nullable fields and enum types, and streamline the AuthenticatedClient initialization. Remove redundant test files and ensure integration tests skip if the API key is not set.

Copilot AI review requested due to automatic review settings July 1, 2025 04:34
@rhythmatician rhythmatician enabled auto-merge July 1, 2025 04:34
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

Enhance the Qualer SDK by replacing an outdated clean-up test, adding a parameterized integration test suite, and improving model nullability and enum handling.

  • Removed the obsolete test_regenerate_sdk_clean.py.
  • Introduced tests/test_endpoints_integration.py with parameterized integration tests that skip when the API key is unset.
  • Streamlined test_all_get_endpoints.py to simplify client initialization.
  • Updated SDK models to support nullable date/time fields, switch enums to IntEnum, and robustly parse nullable values.
  • Extended spec.json with x-nullable flags and correct integer enum formats.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_regenerate_sdk_clean.py Entirely removed outdated clean-up tests.
tests/test_endpoints_integration.py Added comprehensive, parameterized GET endpoint tests.
tests/test_all_get_endpoints.py Simplified AuthenticatedClient initialization and logs.
src/qualer_sdk/models/… Added None support to datetime fields; converted enums to integer-based types; updated parsing logic.
spec.json Marked fields as x-nullable; changed string enums to integer enums.
Comments suppressed due to low confidence (3)

src/qualer_sdk/models/qualer_api_models_report_datasets_to_measurement_field_response_batch_type.py:4

  • [nitpick] Enum members are now named generically (VALUE_0, VALUE_1, VALUE_2), losing semantic clarity. Consider using names derived from x-enumNames (e.g., UNSET, AS_FOUND, AS_LEFT) to preserve readability for API consumers.
class QualerApiModelsReportDatasetsToMeasurementFieldResponseBatchType(IntEnum):

tests/test_all_get_endpoints.py:179

  • AuthenticatedClient is now called with only the API token, but earlier code and other tests expect both a base_url and token. Update this call to match the client constructor signature (e.g., AuthenticatedClient(base_url, token=api_token)).
    client = AuthenticatedClient(api_token)

tests/test_endpoints_integration.py:836

  • Providing a default value here overrides the sample_client_company_id fixture. Remove the =57071 default so pytest will inject the fixture correctly.
def test_client_company_id_endpoint_response_parsing(

Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@rhythmatician rhythmatician merged commit b50cafb into master Jul 1, 2025
8 checks passed
@rhythmatician rhythmatician deleted the test-and-validate-spec branch July 1, 2025 04:38
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.

2 participants