Skip to content

feat/update-analyses-class-and-enable-regions/SDKPY-144#53

Merged
mateuscardosodeveloper merged 8 commits intofeat/updated-account-class/SDKPY-143from
feat/update-analyses-class-and-enable-regions/SDKPY-144
Dec 9, 2025
Merged

feat/update-analyses-class-and-enable-regions/SDKPY-144#53
mateuscardosodeveloper merged 8 commits intofeat/updated-account-class/SDKPY-143from
feat/update-analyses-class-and-enable-regions/SDKPY-144

Conversation

@mateuscardosodeveloper
Copy link
Contributor

@mateuscardosodeveloper mateuscardosodeveloper commented Nov 14, 2025

What does PR do?

🚀 SDK Enhancement: Analyses Class Improvements and Multi-Region Support

This PR enhances the TagoIO Python SDK with two major improvements: comprehensive Analyses class documentation with snippet support, and expanded multi-region capabilities including EU region and TDeploy integration.

📊 Analyses Class - Snippet Integration & Documentation

  • New Methods:
    • listSnippets() - Fetches available code snippets from TagoIO's public repository
    • getSnippetFile() - Retrieves raw source code content of specific snippets
  • Enhanced Documentation: Updated all existing methods with comprehensive docstrings following consistent SDK patterns
    • @description sections with clear explanations
    • @see sections with documentation links
    • @example sections with practical code examples
  • Type Definitions: Added 3 new types for snippet functionality
    • SnippetRuntime - Literal type for supported runtimes (node-legacy, python-legacy, node-rt2025, python-rt2025, deno-rt2025)
    • SnippetItem - Individual snippet metadata structure
    • SnippetsListResponse - API response containing snippets metadata
  • Testing: 8 new test cases covering snippet functionality
  • RST Documentation: Complete documentation with detailed method descriptions and code examples

🌍 Multi-Region Support Enhancement

  • EU Region: Added eu-w1 region support alongside existing us-e1
  • TDeploy Integration: Support for TagoIO Deploy project-based region configuration
    • New RegionsObjTDeploy type for TDeploy project IDs
    • Union type RegionsObj supporting both API/SSE and TDeploy configurations
  • Runtime Caching: Implemented region caching mechanism (runtimeRegion) for improved performance
  • Enhanced API:
    • setRuntimeRegion() - Configure runtime region
    • getConnectionURI() - Retrieve region configuration with automatic environment detection
  • Testing: Comprehensive region tests including TDeploy scenarios (test_tdeploy.py)

🔧 Analysis Runtime Improvements

  • Console Service Integration: Enhanced logging with dedicated ConsoleService integration
  • Error Handling: Improved error handling and graceful shutdowns
  • Type Definitions:
    • AnalysisConstructorParams - Constructor parameters with autostart option
    • AnalysisFunction - Type signature for analysis functions
  • Infrastructure:
    • Removed deprecated api_socket.py
    • Added JSONParseSafe.py utility for safer JSON parsing
    • Updated SSE event listening with better error handling

These changes to match the JavaScript SDK functionality! 🎉

JIRA cards

Type of alteration

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

…ntation

Added listSnippets() and getSnippetFile() methods to fetch analysis code examples from TagoIO's public repository. Enhanced all existing methods with comprehensive docstrings following the Account class pattern, including descriptions, references, and practical examples. Updated type definitions to support new snippet functionality with SnippetRuntime, SnippetItem, and SnippetsListResponse types. Expanded test coverage with 8 new test cases and updated RST documentation with detailed method descriptions and code examples.
Expanded regions.py with EU region support, TDeploy project integration, and runtime region caching. Refactored Analysis class to support async/await execution patterns with improved error handling and console service integration. Removed deprecated api_socket.py infrastructure and added JSONParseSafe utility for safer JSON parsing. Updated Analysis type definitions with new constructor params and function signatures. Added comprehensive region tests covering TDeploy and multi-region scenarios.
@mateuscardosodeveloper mateuscardosodeveloper added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 14, 2025
@mateuscardosodeveloper mateuscardosodeveloper changed the base branch from main to feat/updated-account-class/SDKPY-143 November 14, 2025 14:09
- Add instance attributes (params, started, _running) for better state management
- Fix autostart logic to explicitly check for False instead of falsy values
- Fix region configuration to safely handle missing region parameter using .get()

This improves the Analysis class initialization by adding proper state tracking and preventing potential KeyError when region is not provided.
Restructured Analysis class to separate initialization from execution flow using new init() method pattern. Modified TagoContext from TypedDict to class for better runtime flexibility. Updated documentation examples to reflect Python runtime instead of Deno.
@mateuscardosodeveloper mateuscardosodeveloper merged commit dd099e5 into feat/updated-account-class/SDKPY-143 Dec 9, 2025
3 checks passed
@mateuscardosodeveloper mateuscardosodeveloper deleted the feat/update-analyses-class-and-enable-regions/SDKPY-144 branch December 9, 2025 19:23
mateuscardosodeveloper added a commit that referenced this pull request Dec 9, 2025
* feat: complete Account class implementation with missing methods

- Add getAccountInfo, updateAccountInfo, getAccountStatistics methods
- Add getLimits method for account resource limits
- Add complete type definitions for account operations
- Update documentation with comprehensive examples
- Add unit tests for all new methods (27 tests passing)

* docs: fix Account class documentation formatting and examples

Update documentation with proper RST heading underlines and fix Account.edit() code example to include required id parameter.

* feat/update-analyses-class-and-enable-regions/SDKPY-144 (#53)

* feat: enhance Analyses class with snippet methods and improved documentation

Added listSnippets() and getSnippetFile() methods to fetch analysis code examples from TagoIO's public repository. Enhanced all existing methods with comprehensive docstrings following the Account class pattern, including descriptions, references, and practical examples. Updated type definitions to support new snippet functionality with SnippetRuntime, SnippetItem, and SnippetsListResponse types. Expanded test coverage with 8 new test cases and updated RST documentation with detailed method descriptions and code examples.

* feat: enhance regions support and Analysis runtime with async execution

Expanded regions.py with EU region support, TDeploy project integration, and runtime region caching. Refactored Analysis class to support async/await execution patterns with improved error handling and console service integration. Removed deprecated api_socket.py infrastructure and added JSONParseSafe utility for safer JSON parsing. Updated Analysis type definitions with new constructor params and function signatures. Added comprehensive region tests covering TDeploy and multi-region scenarios.

* feat: enhance Analysis class initialization and region handling

- Add instance attributes (params, started, _running) for better state management
- Fix autostart logic to explicitly check for False instead of falsy values
- Fix region configuration to safely handle missing region parameter using .get()

This improves the Analysis class initialization by adding proper state tracking and preventing potential KeyError when region is not provided.

* feat: update Analysis class to start automatically based on autostart parameter

* feat: modify autostart parameter default to True in Analysis class

* feat: refactor Analysis class initialization and improve region support

Restructured Analysis class to separate initialization from execution flow using new init() method pattern. Modified TagoContext from TypedDict to class for better runtime flexibility. Updated documentation examples to reflect Python runtime instead of Deno.

* feat: update Analysis class to correctly assign analysis_id and environment from environment variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants