Support pathlib Paths #3149
Comments
|
@tadejsv may u point to where |
|
Yes, sure. One of the places it happens is for here Lines 1181 to 1189 in 706b41c |
|
I would like to take on this issue but I'm unaware of the process here, should I ask to be assigned or I can directly submit a PR? |
|
@Bharat123rox we assigned this to you. You can ask for any help |
@tadejsv @JoanFM I'm thinking of two possible approaches here to solve the problem:
s = str(s) if isinstance(s, pathlib.Path) else s
Would you please be able to elaborate and let me know which approach would be better for this? |
|
@Bharat123rox The proper approach is the second one, although it is harder. It might even be worth considering converting all string paths into return val.suffix in ['.yaml', '.yml'] |
|
Hey @tadejsv, in case we are going with the 2nd approach, then does that mean we are only going to fix methods where there are simple string regexes or specific use-cases where (P.S: I'm still working on this, it's been a hectic week and I hope to get a PR by this weekend!) |
Right now, there does not seem to be a very good support for
pathlib.Pathobjects in jina, for examplewill throw an error (as jina tries to apply regex to
Path). In (base) python, path strings andPathobjects can be used interchangably, jina should follow this practice.The text was updated successfully, but these errors were encountered: