skops icon indicating copy to clipboard operation
skops copied to clipboard

Add `private: bool` to hub_utils.push

Open adrinjalali opened this issue 2 years ago • 5 comments

Probably a good idea to allow users to push to a private repo if they want to, by accepting a private: bool attribute on hub_utils.push.

adrinjalali avatar Aug 23 '22 11:08 adrinjalali

How about push just forwarding all kwargs to upload_folder?

BenjaminBossan avatar Aug 23 '22 12:08 BenjaminBossan

We call create_repo and upload_folder though.

adrinjalali avatar Aug 23 '22 12:08 adrinjalali

I just saw that upload_folder had a lot of arguments set to None so that seemed more important to me. Alternatively, we could accept two dicts as arguments, one passed to create_repo and one to upload_folder as kwargs. Picking individual arguments such as private and only supporting those makes it a guessing game which ones are most important, and also is more work when the API is extended in the future.

BenjaminBossan avatar Aug 23 '22 12:08 BenjaminBossan

I very much agree with that, but I think some parameters might be much more used than others, and exposing two dictionary arguments for two underlying method calls kinda seems like we're exposing users to a lot of implementation details. Don't you think?

adrinjalali avatar Aug 23 '22 12:08 adrinjalali

I see your point. In the end, when providing an abstraction like push, we have to balance convenience and flexibility. If we're unsure, we can proceed by only adding private for now, it would still be possible to add more flexibility later.

BenjaminBossan avatar Aug 23 '22 13:08 BenjaminBossan