Repository navigation
Commit 996c6ea
fix: Normalize SQL registry read_path to the psycopg3 driver like path (#6644)
* fix: Normalize SQL registry read_path to the psycopg3 driver like path
RegistryConfig.validate_path rewrites a bare postgresql:// path to
postgresql+psycopg:// (psycopg3) and warns, but SqlRegistryConfig.read_path
had no equivalent validator, so a bare postgresql:// read_path reached
create_engine unchanged and silently used psycopg2 while path used psycopg3.
Factor the rewrite+warning into a shared RegistryConfig._normalize_postgres_scheme
static helper and add a field_validator on read_path that mirrors validate_path.
The helper rewrites only the leading scheme (not later occurrences) and the path
warning text is unchanged.
Add unit tests: read_path normalized (explicit and defaulted registry_type),
explicit +psycopg2/+psycopg and non-postgres schemes left untouched, None stays
None, and the migration warning is emitted.
Fixes #6643
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>
* test: Cover prefix-only PostgreSQL scheme normalization
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
* fix: Address review feedback on read_path validator
Drop the registry_type == "sql" condition from validate_read_path:
SqlRegistryConfig is only ever used for SQL registries, so the check was
redundant (and the now-unused ValidationInfo parameter and import go with
it). Also fix the 'explicitely' typo in the normalization warning message.
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>
---------
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
Co-authored-by: Francisco Javier Arceo <farceo@redhat.com>1 parent a9aaefc commit 996c6ea
3 files changed
Lines changed: 100 additions & 11 deletions
File tree
- sdk/python
- feast
- infra/registry
- tests/unit/infra/registry
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
309 | 318 | | |
310 | 319 | | |
311 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
208 | 231 | | |
209 | 232 | | |
210 | 233 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 234 | + | |
221 | 235 | | |
222 | 236 | | |
223 | 237 | | |
| |||
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
68 | 134 | | |
69 | 135 | | |
70 | 136 | | |
| |||
0 commit comments