fallback
openml._api.resources.base.fallback
#
FallbackProxy
#
Proxy object that provides transparent fallback across multiple API versions.
This class delegates attribute access to a sequence of API implementations.
When a callable attribute is invoked and raises OpenMLNotSupportedError,
the proxy automatically attempts the same method on subsequent API instances
until one succeeds.
| PARAMETER | DESCRIPTION |
|---|---|
*api_versions
|
One or more API implementation instances ordered by priority. The first API is treated as the primary implementation, and subsequent APIs are used as fallbacks.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If no API implementations are provided. |
Notes
Attribute lookup is performed dynamically via __getattr__.
Only methods that raise OpenMLNotSupportedError trigger fallback
behavior. Other exceptions are propagated immediately.
Source code in openml/_api/resources/base/fallback.py
__getattr__
#
Dynamically resolve attribute access across API implementations.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the attribute being accessed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The resolved attribute. If it is callable, a wrapped function providing fallback behavior is returned. |
| RAISES | DESCRIPTION |
|---|---|
AttributeError
|
If none of the API implementations define the attribute. |