Skip to content

feat: support SDMX proxy #126#127

Open
kryachkow wants to merge 17 commits intodevelopmentfrom
126-support-integration-with-sdmx-30-proxy-api
Open

feat: support SDMX proxy #126#127
kryachkow wants to merge 17 commits intodevelopmentfrom
126-support-integration-with-sdmx-30-proxy-api

Conversation

@kryachkow
Copy link
Contributor

@kryachkow kryachkow commented Feb 5, 2026

Applicable issues

Description of changes

  • Introduced new YAML configurations for IMF proxy channels, data sources
  • Implemented a new database migration for the Proxy SDMX 3.0 data source type.
  • Updated the data manager to support the new Proxy SDMX 3.0 configuration.
  • Enhanced existing schemas to accommodate new proxy data structures.

This update enhances the functionality and data handling capabilities of the SDMX proxy system.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@kryachkow kryachkow requested a review from ypldan as a code owner February 5, 2026 07:36
@kryachkow kryachkow linked an issue Feb 5, 2026 that may be closed by this pull request
@kryachkow kryachkow self-assigned this Feb 5, 2026
@kryachkow kryachkow requested review from Fedir-Yatsenko and removed request for ypldan February 5, 2026 07:36
)
from .updated_at_mixin import UpdatedAtMixin

__all__ = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

__all__ doesn't add value here. Everything listed in it is already explicitly imported at the top of the file, so a from statgpt.common.data.common import * wildcard import would pick up exactly those names regardless — __all__ just duplicates the import list.

__all__ is useful when:

  • A module defines names locally and you want to control which ones are public
  • You want to exclude some imported names from wildcard exports
  • The module uses import statements that bring in names you don't want re-exported

None of those apply here. Consider removing __all__.

Copy link
Collaborator

Choose a reason for hiding this comment

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

statgpt/common/data/proxy/sdmx_schemas/init.py
statgpt/common/data/proxy/v30/init.py
statgpt/common/data/proxy/init.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is now part of the basic package, let's think about what is part of the SDMX standard, and what is SDMX+? For SDMX+ schemas, I would name the file something like sdmx_plus_schemas.py. POST is definitely not part of the standard, at least not yet, but I believe Annotation is, so we can leave it in this file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or there may be some hierarchy, such as:

sdmx_schemas/
├── __init__.py
├── sdmx_30.py
└── sdmx_plus.py

return AsyncProxySdmxClient.from_config(self._config, auth_context, rate_limiter)

def _should_use_cache(self, allow_cached: bool) -> bool:
auth_enabled = getattr(self._config, "auth_enabled", False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no such property in the ProxySdmx30DataSourceConfig class, and I'm not sure if it will appear in the near future.

class ProxySdmx30DataSourceConfig(SdmxDataSourceConfig):
"""Configuration for SDMX 3.0 proxy data sources that still use sdmx1 parsing."""

versions: set[str] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this used anywhere?

async def _get_dataset(
def _should_use_cache(self, allow_cached: bool) -> bool:
auth_enabled = getattr(self._config, "auth_enabled", False)
return allow_cached and not auth_enabled
Copy link
Collaborator

@Fedir-Yatsenko Fedir-Yatsenko Mar 16, 2026

Choose a reason for hiding this comment

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

Whenever possible, let's use the field directly rather than getattr. Or is there a reason why not to do the following way here?

    def _should_use_cache(self, allow_cached: bool) -> bool:
        return allow_cached and not self._config.auth_enabled

)
key = {} if key is None else key
req_body_obj = QhAvailabilityRequestBody.get_from(key=key, params=params)
req_body_obj = PostAvailabilityRequestBody.get_from(key=key, params=params)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is PostAvailabilityRequestBody supposed to be used in the QuantHub package? If so, perhaps we should move this into the SDMX+ schemas of base package? And give it a more general name?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There may be some code duplication from the sdmx1 library, let's try to remove it.

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.

Support integration with SDMX 3.0 proxy API

2 participants