Description
For a SQL registry, RegistryConfig.validate_path rewrites a bare postgresql:// URL in path to postgresql+psycopg:// so SQLAlchemy uses the psycopg3 driver, and logs a warning explaining the rewrite. read_path gets no equivalent treatment. It has no validator, so a bare postgresql:// read_path reaches create_engine unchanged and SQLAlchemy falls back to the psycopg2 driver, diverging from path (which used psycopg3) with no warning.
If psycopg2 isn't installed, or a project has standardized on psycopg3, this fails at connection time with nothing pointing at read_path as the odd one out.
Reproduction
from feast.infra.registry.sql import SqlRegistryConfig
config = SqlRegistryConfig(
path="postgresql://user@host/db",
read_path="postgresql://user@host/replica",
)
print(config.path) # postgresql+psycopg://user@host/db (rewritten + warned)
print(config.read_path) # postgresql://user@host/replica (untouched, no warning)
Expected
read_path should normalize the same way path does: rewrite a leading postgresql:// to postgresql+psycopg:// and log the same migration warning. An explicit postgresql+psycopg2:// should be left as-is, matching the existing path behavior.
Details
validate_path is a @field_validator("path") on RegistryConfig in sdk/python/feast/repo_config.py, gated on registry_type == "sql". read_path is declared on SqlRegistryConfig in sdk/python/feast/infra/registry/sql.py; it inherits the path validator but has none of its own, so it flows straight into create_engine(registry_config.read_path, ...).
Affects 0.64.0 and current master. A PR follows.
Description
For a SQL registry,
RegistryConfig.validate_pathrewrites a barepostgresql://URL inpathtopostgresql+psycopg://so SQLAlchemy uses the psycopg3 driver, and logs a warning explaining the rewrite.read_pathgets no equivalent treatment. It has no validator, so a barepostgresql://read_path reachescreate_engineunchanged and SQLAlchemy falls back to the psycopg2 driver, diverging frompath(which used psycopg3) with no warning.If psycopg2 isn't installed, or a project has standardized on psycopg3, this fails at connection time with nothing pointing at read_path as the odd one out.
Reproduction
Expected
read_path should normalize the same way path does: rewrite a leading
postgresql://topostgresql+psycopg://and log the same migration warning. An explicitpostgresql+psycopg2://should be left as-is, matching the existing path behavior.Details
validate_pathis a@field_validator("path")onRegistryConfiginsdk/python/feast/repo_config.py, gated onregistry_type == "sql".read_pathis declared onSqlRegistryConfiginsdk/python/feast/infra/registry/sql.py; it inherits the path validator but has none of its own, so it flows straight intocreate_engine(registry_config.read_path, ...).Affects 0.64.0 and current master. A PR follows.