kubeflow / training-operator

Distributed ML Training and Fine-Tuning on Kubernetes
https://www.kubeflow.org/docs/components/training
Apache License 2.0
1.52k stars 661 forks source link

fix(compatability): match-case syntax only compatible with Python3.10 #2096

Open PantherHawk opened 2 months ago

PantherHawk commented 2 months ago

what's the problem Match case syntax is not compatible with earlier Python versions.

https://github.com/kubeflow/training-operator/blob/f8f7363eb905757e7c05321ec8df81aed61cf6c6/sdk/python/kubeflow/storage_initializer/storage.py#L7-L28

what's the fix? Use if-else instead.

tenzen-y commented 2 months ago

Thank you for reporting this!

That makes sense. We should replace the match with if-else, and then we should cherry-pick it to the latest release-branch.

tenzen-y commented 2 months ago

cc: @andreyvelich @johnugeorge

tenzen-y commented 2 months ago

It seems that PR already has been created: #2099

akhilsaivenkata commented 1 month ago

Hi @tenzen-y , I think the contributor of PR #2099 has been inactive for 2 weeks. Will it be fine If I take this up and create a new PR?

andreyvelich commented 1 month ago

@PantherHawk Thank you for creating this! Currently, Storage Initializer image is using Python 3.11 version: https://github.com/kubeflow/training-operator/blob/master/sdk/python/kubeflow/storage_initializer/Dockerfile#L2 Do you have any specific use-case when you need to use Python 3.9 ?