Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#6148] improve(CLI): Refactor model commands in Gavitino CLI #6162

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

Abyss-lord
Copy link
Contributor

What changes were proposed in this pull request?

Refactor model commands and Base class in Gavitino CLI.

Why are the changes needed?

Fix: #6148

Does this PR introduce any user-facing change?

No

How was this patch tested?

local test

Refactor model commands and Base class in Gavitino CLI.
@Abyss-lord
Copy link
Contributor Author

Hi @justinmclean @tengqm , could you please review this PR when you have time? I’d really appreciate your feedback.

this.metalake = name.getMetalakeName();
this.catalog = name.getCatalogName();
this.schema = name.getSchemaName();
this.model = name.getModelName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to cause an issue with the list command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
getModelName will return null if names.length <= position, list command is executed first, IMHO, It should be retrieved in the constructor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even so, you should not call it if it is not needed. It will put out an error message saying the name is malformed - we don't want this as it will confuse the user. I'd remove the final and set it after the list command call.

@Abyss-lord
Copy link
Contributor Author

Hi @justinmclean , I’ve finished updating the code. Please take a look at the PR again when you have time.

Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another contribution.

@justinmclean justinmclean merged commit 9e3b98f into apache:main Jan 9, 2025
27 checks passed
@Abyss-lord Abyss-lord deleted the refactor-model-command branch January 10, 2025 01:13
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this pull request Jan 10, 2025
…pache#6162)

### What changes were proposed in this pull request?

Refactor model commands and Base class in Gavitino CLI.

### Why are the changes needed?

Fix: apache#6148 

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

local test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor model commands in Gavitino CLI
2 participants