refactor(dataflows): name the unavailable-vendor error for what it covers

- VendorRateLimitError is VendorUnavailableError: a vendor that throttled or failed the request
This commit is contained in:
Yijia-Xiao
2026-09-29 05:57:18 +00:00
parent a6318b31cc
commit 00924bb203
12 changed files with 42 additions and 39 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ from tradingagents.dataflows.errors import (
NoMarketDataError,
VendorError,
VendorNotConfiguredError,
VendorRateLimitError,
VendorUnavailableError,
)
from tradingagents.dataflows.vendors.alpha_vantage.common import (
AlphaVantageNotConfiguredError,
@@ -28,7 +28,7 @@ from tradingagents.dataflows.vendors.fred import FredNotConfiguredError
@pytest.mark.unit
class HierarchyTests(unittest.TestCase):
def test_all_conditions_derive_from_vendor_error(self):
for cls in (NoMarketDataError, VendorRateLimitError, VendorNotConfiguredError):
for cls in (NoMarketDataError, VendorUnavailableError, VendorNotConfiguredError):
self.assertTrue(issubclass(cls, VendorError))
def test_not_configured_is_still_a_value_error(self):
@@ -36,7 +36,7 @@ class HierarchyTests(unittest.TestCase):
self.assertTrue(issubclass(VendorNotConfiguredError, ValueError))
def test_vendor_named_errors_subclass_the_generic_bases(self):
self.assertTrue(issubclass(AlphaVantageRateLimitError, VendorRateLimitError))
self.assertTrue(issubclass(AlphaVantageRateLimitError, VendorUnavailableError))
self.assertTrue(issubclass(AlphaVantageNotConfiguredError, VendorNotConfiguredError))
self.assertTrue(issubclass(FredNotConfiguredError, VendorNotConfiguredError))
# ... and therefore still ValueErrors