-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK task.upload_data() cannot be used with resources of the Path type #9072
Comments
what should I do to face the bug and what does this line print when the bug happens
|
Ax example: from pathlib import PurePosixPath
from cvat_sdk import make_client, models
from cvat_sdk.core.proxies.tasks import ResourceType
with make_client("http://localhost", port=8080, credentials=("user", "pass")) as client:
task = client.tasks.create_from_data(
spec=models.TaskWriteRequest(
name="image task with cs",
labels=[{"name": "cat"}],
),
resources=[PurePosixPath("image1.png"), PurePosixPath("image2.png")],
resource_type=ResourceType.SHARE,
data_params=dict(
cloud_storage_id=your_cloud_storage_id,
image_quality=70,
),
) |
can't we just replace from _typeshed import StrPath, SupportsWrite with from _typeshed import SupportsWrite
from os import PathLike |
Doing so won't change the error. The function still fails when |
So, we need to add logic for type conversions inside the for loop, such as converting Posix to string, right? If that's the case, I'd love to take care of it! |
So can you assign this issue to me. I have set the development environment according to the guidelines. And I guess there won't be an issue with the |
Actions before raising this issue
Steps to Reproduce
SDK has a
Task.upload_data()
, which claims to supportStrPath
-typedresource
s, but it is actually only works forLOCAL
resource_type
.cvat/cvat-sdk/cvat_sdk/core/proxies/tasks.py
Line 73 in fec040d
Expected Behavior
Task should be created.
Possible Solution
Remove invalid error here:
cvat/cvat-sdk/cvat_sdk/core/proxies/tasks.py
Lines 112 to 114 in fec040d
Context
No response
Environment
The text was updated successfully, but these errors were encountered: