Skip to content

Could not import module 'hybrid_online_store' #5630

Description

@fcas

Expected Behavior

Import hybrid_online_store module correctly, according to this documentation: https://github.com/feast-dev/feast/blob/master/docs/reference/online-stores/hybrid.md.

Current Behavior

Could not import module 'hybrid_online_store'

Steps to reproduce

Use the following RepoConfig:

repo_config = RepoConfig(
    **{
        "project": "prod",
        "registry": {
            "registry_type": "sql",
            "path": os.getenv("DATABASE_URL"),
            "cache_ttl_seconds": 0,
            "sqlalchemy_config_kwargs": {
                "max_overflow": 50,
                "pool_size": 5,
                "pool_recycle": 3600,
            },
        },
        "provider": "aws",
        "entity_key_serialization_version": 3,
        "online_store": {
            "type": "hybrid_online_store.HybridOnlineStore",
            "routing_tag": "store",
            "online_stores": [
                {
                    "type": "dynamodb",
                    "conf": {
                        "region": "us-east-1",
                        "max_pool_connections": 50,
                        "connect_timeout": 5,
                        "read_timeout": 10,
                        "total_max_retry_attempts": 2
                    }
                },
                {
                    "type": "redis",
                    "conf": {
                        "connection_string": os.getenv("REDIS_URL")
                    }
                }
            ],
        },
    }
)

Specifications

  • Version: 0.53.0
  • Platform: macOs 14.6.1
  • Subsystem: Python 3.12

Possible Solution

Use the following config:

repo_config = RepoConfig(
    **{
        "project": "prod",
        "registry": {
            "registry_type": "sql",
            "path": os.getenv("DATABASE_URL"),
            "cache_ttl_seconds": 0,
            "sqlalchemy_config_kwargs": {
                "max_overflow": 50,
                "pool_size": 5,
                "pool_recycle": 3600,
            },
        },
        "provider": "aws",
        "entity_key_serialization_version": 3,
        "online_store": {
            "type": "feast.infra.online_stores.hybrid_online_store.hybrid_online_store.HybridOnlineStore",
            "routing_tag": "store",
            "online_stores": [
                {
                    "type": "dynamodb",
                    "conf": {
                        "region": "us-east-1",
                        "max_pool_connections": 50,
                        "connect_timeout": 5,
                        "read_timeout": 10,
                        "total_max_retry_attempts": 2
                    }
                },
                {
                    "type": "redis",
                    "conf": {
                        "connection_string": os.getenv("REDIS_URL")
                    }
                }
            ],
        },
    }
)

Also, it's necessary to change the type attribute in hybrid_online_store.py (https://github.com/feast-dev/feast/blob/master/sdk/python/feast/infra/online_stores/hybrid_online_store/hybrid_online_store.py) from:

    type: Literal["HybridOnlineStore", "hybrid_online_store.HybridOnlineStore"] = (
        "hybrid_online_store.HybridOnlineStore"
    )

To:

    type: Literal["HybridOnlineStore", "feast.infra.online_stores.hybrid_online_store.hybrid_online_store.HybridOnlineStore"] = (
        "hybrid_online_store.HybridOnlineStore"
    )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions