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

Fix deprecated wandb api call #222

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Fix deprecated wandb api call #222

merged 1 commit into from
Jan 23, 2025

Conversation

mg515
Copy link
Contributor

@mg515 mg515 commented Jan 23, 2025

wandb: WARNING Api.artifact_versions(type_name, name) is deprecated, use Api.artifacts(type_name, name) instead.

@mg515 mg515 requested a review from SebS94 January 23, 2025 11:34
@mg515
Copy link
Contributor Author

mg515 commented Jan 23, 2025

Should be exactly the drop-in replacement


    @normalize_exceptions
    def artifact_versions(self, type_name, name, per_page=50):
        """Deprecated, use artifacts(type_name, name) instead."""
        deprecate(
            field_name=Deprecated.api__artifact_versions,
            warning_message=(
                "Api.artifact_versions(type_name, name) is deprecated, "
                "use Api.artifacts(type_name, name) instead."
            ),
        )
        return self.artifacts(type_name, name, per_page=per_page)

    @normalize_exceptions
    def artifacts(self, type_name, name, per_page=50):
        entity, project, collection_name = self._parse_artifact_path(name)
        return public.Artifacts(
            self.client, entity, project, collection_name, type_name, per_page=per_page
        )

@mg515 mg515 requested a review from MsMatias January 23, 2025 11:37
Copy link

@MsMatias MsMatias left a comment

Choose a reason for hiding this comment

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

lgtm. not so much I can contribute yet

@mg515 mg515 merged commit 8e866ec into main Jan 23, 2025
4 checks passed
@mg515 mg515 deleted the miha-fix-depricated branch January 23, 2025 12:00
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants