Repository navigation
Commit 099ed03
committed
Fix Db2ConnectionConfig.get_catalog() to return lowercase — align _default_catalog
The previous commit fixed get_current_catalog() in db2.py to return lowercase
('testdb'). But Db2ConnectionConfig.get_catalog() was still returning uppercase
('TESTDB'), which is passed as default_catalog= to the adapter constructor and
stored in _default_catalog.
The set_catalog decorator in shared.py:346 compares catalog_name (from the model
definition, lowercased by the DuckDB-dialect config parser) against
engine_adapter._default_catalog. With _default_catalog='TESTDB' and
catalog_name='testdb', the raw == comparison fails and raises SQLMeshError.
Fix: return catalog.lower() instead of catalog.upper() in get_catalog().
This makes _default_catalog='testdb', matching both get_current_catalog() and
the catalog names produced by the DuckDB-dialect config parser.
The set_catalog decorator strips the catalog from all DDL before sending it to
Db2, so the case of this value never affects SQL sent to the engine.1 parent 9d6d9e7 commit 099ed03
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2650 | 2650 | | |
2651 | 2651 | | |
2652 | 2652 | | |
2653 | | - | |
2654 | | - | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
2655 | 2658 | | |
2656 | | - | |
| 2659 | + | |
2657 | 2660 | | |
2658 | 2661 | | |
2659 | 2662 | | |
| |||
0 commit comments