Accept both str and Path types for functions in databricks/sdk/service/files.py#740
Accept both str and Path types for functions in databricks/sdk/service/files.py#740fpgmaas wants to merge 2 commits intodatabricks:mainfrom
str and Path types for functions in databricks/sdk/service/files.py#740Conversation
mgyucht
left a comment
There was a problem hiding this comment.
Hi @fpgmaas, thanks for contributing this change to the SDK! Unfortunately, the code you're modifying is autogenerated and would be overwritten in the next SDK release if merged. Implementing this would require a change in our codegen tool itself. Can I ask you to make a feature request instead?
So that I understand the rationale: "This can lead to confusing behavior for end-users when passing in a Path object." The interfaces for these methods all specify that they accept strings. Can users just call str(...) themselves before using these methods?
Thanks for your response. I overlooked the comment
Yes, that will definitely work. However, the error that is thrown is not very clear which makes it a bit annoying to debug. So for a better user experience I think allowing |
Changes
Currently, the functions in
databricks/sdk/service/files.pyaccept onlystrfor arguments that are paths. This can lead to confusing behavior for end-users when passing in aPathobject.Tests
I parametrized the unit tests.
make testrun locallymake fmtapplied