fix(cli): report correct entity type for missing property - #1621
Conversation
ba03430 to
089af7e
Compare
tanmayrauth
left a comment
There was a problem hiding this comment.
Fix is correct — validateEntityType guarantees get.Type is only ever "namespace" or "table", so the interpolated message is safe. Couple of nits inline.
| panic("UpdateNamespaceProperties must not be called") | ||
| } | ||
|
|
||
| func TestRunPropertiesGetNamespaceNotFound로(t *testing.T) { |
There was a problem hiding this comment.
The test name TestRunPropertiesGetNamespaceNotFound로 has a stray Korean character 로 on the end — looks like an accidental keystroke. It compiles and runs (Go allows Unicode identifiers), but it shows up as garbage in CI logs and when grepping test names, and it's inconsistent with the sibling TestRunPropertiesGetTableNotFound. Rename to TestRunPropertiesGetNamespaceNotFound.
| output.Error(fmt.Errorf("could not find property %s on %s %s", get.PropName, get.Type, get.Identifier)) | ||
| osExit(1) | ||
|
|
||
| return |
There was a problem hiding this comment.
The return here is unreachable — osExit is os.Exit in prod (never returns) and panics in tests, and this is already the end of the case. Harmless, but you can drop it.
- and modfiied os.Exit to osExit for testcode
089af7e to
e48339a
Compare
Summary
properties getalways reported "on namespace" in its error message even when the target was a table, since the message was hardcoded instead of using the actual entity type.fmt.Errorfwithget.Typeso the message reflects "namespace" or "table" correctly.properties getreports correct entity type on missing propertyTest plan
go test ./cmd/iceberg/Ran against a local hadoop catalog, requesting a non-existent property:
Before
After