Skip to content

Conversation

@michael-linnane-lrn
Copy link
Contributor

@michael-linnane-lrn michael-linnane-lrn commented Dec 11, 2025

This pull request introduces several improvements and fixes across the codebase, primarily focusing on enhanced type safety, expanded Data API support, and improved CI reliability. The most notable changes include stricter type checks for request handling, the addition of Data API configuration and demo, and fixes for mypy lint errors and missing type imports.

Type Safety and Request Handling Improvements

  • Updated all checks for self.request in learnosity_sdk/request/init.py to use isinstance(self.request, dict) for safer type handling, preventing runtime errors and making the code more robust. [1] [2] [3] [4]

Data API Enhancements

  • Added Data API configuration to request signatures and introduced a Data API demo to the standalone demos, expanding the SDK's capabilities.

CI and Linting Reliability

  • Fixed mypy errors that were causing lint check failures during CI builds, ensuring smoother and more reliable automated testing.
  • Added missing import for types-setuptools in setup.py to resolve type checking issues during testing.

Setup Script Improvements

  • Explicitly typed the version dictionary in setup.py for better clarity and compatibility with type checkers.

Checklist

  • Feature

  • Bug

  • Security

  • Documentation

  • ChangeLog.md updated

  • Tests added

  • All testsuites passed

  • make dist completed successfully

  • Bump package version if release coming

Copy link

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 resolves type-checking issues by enhancing type safety throughout the SDK, particularly in request handling and configuration. The changes primarily address mypy lint failures that were affecting CI builds and add Data API support to expand the SDK's functionality.

Key changes include:

  • Replaced is not None checks with isinstance(self.request, dict) throughout request handling code for stricter type safety
  • Added explicit type annotations and missing type stub imports to resolve mypy errors
  • Updated ChangeLog.md to document the Data API additions and lint fixes

Reviewed changes

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

File Description
setup.py Added type annotation for version dictionary and types-setuptools dependency to resolve type checking issues
learnosity_sdk/request/init.py Replaced null checks with isinstance() checks for safer dictionary type handling across multiple service methods
ChangeLog.md Documented Data API additions and mypy error fixes for this release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jack-oconnor-lrn
Copy link

Looks good to me 💪.

I had to make this fix during the hackathon for the Data API demo. Might be worth fixing here in this PR as well if updating the docs to mention Data API is added to the demos

Copy link

@jack-oconnor-lrn jack-oconnor-lrn left a comment

Choose a reason for hiding this comment

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

Agreed to address the signature hashing bug in a separate PR

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