Skip to content

Match the argument order of download_artifact to that of upload_artifact#5529

Closed
nabenabe0928 wants to merge 1 commit intooptuna:masterfrom
nabenabe0928:code-fix/order-arg-order
Closed

Match the argument order of download_artifact to that of upload_artifact#5529
nabenabe0928 wants to merge 1 commit intooptuna:masterfrom
nabenabe0928:code-fix/order-arg-order

Conversation

@nabenabe0928
Copy link
Copy Markdown
Contributor

Motivation

I united the argument order of download_artifact to that of upload_artifact to avoid confusion.

@nabenabe0928 nabenabe0928 added the compatibility Change that breaks compatibility. label Jun 27, 2024
@nabenabe0928 nabenabe0928 added this to the v4.0.0 milestone Jun 27, 2024
@y0z y0z requested a review from c-bata June 28, 2024 02:21
@y0z y0z removed the request for review from c-bata June 28, 2024 02:22
@y0z
Copy link
Copy Markdown
Member

y0z commented Jun 28, 2024

@c-bata, @porink0424 Could you review this PR?

@toshihikoyanase
Copy link
Copy Markdown
Member

Could you show us the correspondence of the arguments between download_artifact and upload_artifact , please?

@nabenabe0928
Copy link
Copy Markdown
Contributor Author

@toshihikoyanase
The current API for each function looks like this:

def upload_artifact(study_or_trial, file_path, artifact_store, ...) -> str:
    ...

def download_artifact(artifact_store, artifact_id, file_path) -> None:
    ...

I updated download_artifact to:

def download_artifact(file_path, artifact_store, artifact_id) -> None:
    ...

so that file_path comes before artifact_store for both functions.
Another possibility is to make them:

def upload_artifact(artifact_store, file_path, study_or_trial,  ...) -> str:
    ...

def download_artifact(artifact_store, file_path, artifact_id) -> None:
    ...

Although this change makes the order clearer, it will be a breaking change.
I avoided the breaking change in this PR, but what do you think, @c-bata ?

Copy link
Copy Markdown
Member

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

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

I think this change is enough, and further breaking change is a bit much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility Change that breaks compatibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants