Example updating artefact is weird

The example on how to update an artefact is given here https://docs.wandb.ai/guides/artifacts/update-an-artifact. I find it rather odd. Could you clarify the rationale behind creating artefact twice?

import wandb

run = wandb.init(project="<example>", job_type="<job-type>")
artifact = run.use_artifact("<artifact-name>:<alias>")

artifact = wandb.Artifact("")
run.use_artifact(artifact)
artifact.description = "<description>"
artifact.save()

What I am trying to do: after updating the files in my directory (only referenced by Wandb), I want to obtain an artefact Myartifact:v<n+1> .

Hello @cemde thank you for writing in and flagging this one. We’ll do necessary changes to our doc, I’ll get back for your question too.

Hi @cemde our team updated the said doc, you may check it now. As per your inquiry: updating an artifact does not change the digest of the artifact. Updating is attributed to description , metadata , and alias of the artifact. Artifacts perform a checksum on the contents of the artifact and compare digests, if this checksum is different we will revision up an artifact and log it as a new artifact, otherwise it remains at it’s last version.

Hi @cemde , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

Thank you for updating it. Could you explain the rational behind this?

...
artifact = run.use_artifact("<artifact-name>:<alias>")
run.use_artifact(artifact)
...

Why should I call run.use_artifacts twice?

Hi @cemde , thank you for bringing this to our attention, we updated our docs again for this to be reflected. Hope all will work on your end.