georgereuben commented on code in PR #7965:
URL: https://github.com/apache/gravitino/pull/7965#discussion_r2274017035
##########
api/src/main/java/org/apache/gravitino/Namespace.java:
##########
@@ -75,7 +75,8 @@ public static Namespace of(String... levels) {
*/
public static Namespace fromString(String namespace) {
Preconditions.checkArgument(namespace != null, "Cannot create a namespace
with null input");
- Preconditions.checkArgument(!namespace.endsWith("."), "Cannot create a
namespace end with dot");
+ Preconditions.checkArgument(!namespace.contains(" "), "Cannot create a
namespace containing whitespace");
Review Comment:
I think this would invalidate legitimate namespaces which might have a
space. a possible alternative could be to alter line 86 to be
`if(namespace.isEmpty()) {return empty()}` and to add a precondition check
using `StringUtils.isBlank()` after this check so that empty namespaces return
`Namespace.empty` and only purely whitespace namespaces are caught by the
precondition check.
@justinmclean , what would you suggest?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]