You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "XD-DENG (via GitHub)" <gi...@apache.org> on 2026/08/22 21:36:15 UTC
[PR] Fix: CLI 'catalogs create --type external' skips required-flag validation, leaking a pydantic ValidationError [polaris]
XD-DENG opened a new pull request, #5353:
URL: https://github.com/apache/polaris/pull/5353
## Problem
When we call `polaris catalogs create <name> --type external ...`, if we omit required flags `--storage-type` or `--default-base-location`, it exits non-zero with an opaque pydantic `ValidationError` that names an internal SDK field rather than the CLI flag the user should pass.
`CatalogsCommand.validate()` enforces both flags only for **non-external** catalogs. The CLI's own option tree (`options/option_tree.py:234, :241`) and user docs already mark both flags **"(Required)"** unconditionally, so this is a mismatch between the CLI's advertised contract and its actual enforcement.
The issue was most likely introduced by PR #1912 (federation support, July 2025). The exempted path has never been a reachable design, because both flags have been `required` in the OpenAPI spec since commit #1 (July 2024, a year earlier).
## How to reproduce
### 1. Missing `--storage-type` (with `--default-base-location` given)
```
polaris --access-token dummy --base-url http://127.0.0.1:1 \
catalogs create foo --type external --default-base-location dbl \
--catalog-connection-type hadoop --hadoop-warehouse w --catalog-uri u
```
### 2. Missing `--default-base-location` (with `--storage-type` given)
```
polaris --access-token dummy --base-url http://127.0.0.1:1 \
catalogs create foo --type external --storage-type file \
--catalog-connection-type hadoop --hadoop-warehouse w --catalog-uri u
```
### For reference — a fully-valid invocation
It should pass (unless we don't have server set up, in which case we should only see the HTTP call fails)
```
polaris --access-token dummy --base-url http://127.0.0.1:1 \
catalogs create foo --type external --storage-type file --default-base-location dbl \
--catalog-connection-type hadoop --hadoop-warehouse w \
--catalog-authentication-type implicit --catalog-uri u
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix: CLI 'catalogs create --type external' skips required-flag validation, leaking a pydantic ValidationError [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode merged PR #5353:
URL: https://github.com/apache/polaris/pull/5353
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix: CLI 'catalogs create --type external' skips required-flag validation, leaking a pydantic ValidationError [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on PR #5353:
URL: https://github.com/apache/polaris/pull/5353#issuecomment-5383818487
Hello @XD-DENG ,
That is for sure a required field according to the spec: https://github.com/apache/polaris/blob/main/spec/polaris-management-service.yml#L868
This appears to be added via https://github.com/XD-DENG/polaris/commit/eb6b6ad50f33d0ac73c92753063438dcf428c9db but I am not seeing any reason on why external one was excluded. I do think the change from this PR is correct.
@flyrain mind take another look?
Thanks,
Yong Zheng
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix: CLI 'catalogs create --type external' skips required-flag validation, leaking a pydantic ValidationError [polaris]
Posted by "XD-DENG (via GitHub)" <gi...@apache.org>.
XD-DENG commented on PR #5353:
URL: https://github.com/apache/polaris/pull/5353#issuecomment-5383892118
Thanks @MonkeyCanCode for reviewing this PR so promptly, and glad that you agree this PR is making correct change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org