[PR #782] [CLOSED] Refactor Financial Datasets API integration #ieeesoc #1169

Closed
opened 2026-02-22 17:50:02 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugins/pull/782
Author: @anu-rrn1
Created: 6/26/2025
Status: Closed

Base: mainHead: Refactor-Financial-Datasets-API-Integration


📝 Commits (1)

  • 29c4d32 Refactor Financial Datasets API integration with structured error handling and modular request methods

📊 Changes

1 file changed (+187 additions, -0 deletions)

View changed files

FinancialAI/financialdatasets/tools/base.py (+187 -0)

📄 Description

…dling and modular request methods

Plugin Submission Form

1. Metadata

  • Plugin Author:
  • Plugin Name:
  • Repository URL:

2. Submission Type

  • New plugin submission
  • Version update for existing plugin

3. Description

Refactored the Financial Datasets API wrapper for improved code modularity, error handling, and type safety. Introduced a unified internal request handler to reduce code duplication across GET and POST methods.
Changes Made:
Introduced a centralized _send_request() method supporting both GET and POST operations.
Enhanced HTTP response validation via _is_request_successful() and _handle_api_response() functions.
Replaced generic Exception handling with a custom FinancialDatasetsAPIError class.
Filtered out None values from query parameters to prevent malformed API requests.
Added stricter type annotations using Optional, Enum, and Dict[str, Any].
Updated docstrings for improved clarity and developer experience.
Preserved backward-compatible http_get() and http_post() interfaces.
Benefits:
Better separation of concerns and error traceability.
Promotes code reuse and cleaner request management.
Easier to maintain, extend, and debug.

4. Checklist

  • I have read and followed the Publish to Dify Marketplace guidelines
  • I have read and comply with the Plugin Developer Agreement
  • I confirm my plugin has been thoroughly tested for completeness and functionality
  • My plugin brings new value to Dify

5. Documentation Checklist

Please confirm that your plugin README includes all necessary information:

  • Step-by-step setup instructions
  • Detailed usage instructions
  • All required APIs and credentials are clearly listed
  • Connection requirements and configuration details
  • Link to the repository for the plugin source code

6. Privacy Protection Information

Based on Dify Plugin Privacy Protection Guidelines:

Data Collection

Privacy Policy

  • I confirm that I have prepared and included a privacy policy in my plugin package based on the Plugin Privacy Protection Guidelines

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugins/pull/782 **Author:** [@anu-rrn1](https://github.com/anu-rrn1) **Created:** 6/26/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `Refactor-Financial-Datasets-API-Integration` --- ### 📝 Commits (1) - [`29c4d32`](https://github.com/langgenius/dify-plugins/commit/29c4d32b12b42405d938be8e7ee3d2b5cdbc6c3d) Refactor Financial Datasets API integration with structured error handling and modular request methods ### 📊 Changes **1 file changed** (+187 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `FinancialAI/financialdatasets/tools/base.py` (+187 -0) </details> ### 📄 Description …dling and modular request methods # Plugin Submission Form ## 1. Metadata <!-- Please provide the following metadata of your plugin to make it easier for the reviewer to check the changes. - Plugin Author : financialai - Plugin Name : financialdatasets - Repository URL: https://github.com/langgenius/dify-plugins/blob/main/FinancialAI/financialdatasets/financialdatasets.difypkg --> - **Plugin Author**: - **Plugin Name**: - **Repository URL**: ## 2. Submission Type - [x] New plugin submission - [ ] Version update for existing plugin ## 3. Description <!-- Please briefly describe the purpose of the new plugin or the updates made to the existing plugin --> Refactored the Financial Datasets API wrapper for improved code modularity, error handling, and type safety. Introduced a unified internal request handler to reduce code duplication across GET and POST methods. Changes Made: ✅ Introduced a centralized _send_request() method supporting both GET and POST operations. ✅ Enhanced HTTP response validation via _is_request_successful() and _handle_api_response() functions. ✅ Replaced generic Exception handling with a custom FinancialDatasetsAPIError class. ✅ Filtered out None values from query parameters to prevent malformed API requests. ✅ Added stricter type annotations using Optional, Enum, and Dict[str, Any]. ✅ Updated docstrings for improved clarity and developer experience. ✅ Preserved backward-compatible http_get() and http_post() interfaces. Benefits: Better separation of concerns and error traceability. Promotes code reuse and cleaner request management. Easier to maintain, extend, and debug. ## 4. Checklist - [x] I have read and followed the Publish to Dify Marketplace guidelines - [x] I have read and comply with the Plugin Developer Agreement - [x] I confirm my plugin has been thoroughly tested for completeness and functionality - [x] My plugin brings new value to Dify ## 5. Documentation Checklist Please confirm that your plugin README includes all necessary information: - [x] Step-by-step setup instructions - [x] Detailed usage instructions - [x] All required APIs and credentials are clearly listed - [x] Connection requirements and configuration details - [x] Link to the repository for the plugin source code ## 6. Privacy Protection Information Based on Dify Plugin Privacy Protection [Guidelines](https://docs.dify.ai/plugins/publish-plugins/publish-to-dify-marketplace/plugin-privacy-protection-guidelines): ### Data Collection <!-- Does your plugin collect any user personal data? If yes, please list what types of user personal data are being collected according to the Plugin Privacy Protection Guidelines (for example: Email address, IP address, Age, etc) --> ### Privacy Policy - [x] I confirm that I have prepared and included a privacy policy in my plugin package based on the Plugin Privacy Protection Guidelines --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 17:50:02 -05:00
yindo closed this issue 2026-02-22 17:50:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugins#1169