Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More fixes
  • Loading branch information
dargilco committed Apr 28, 2025
commit 8a063039dec9d0b4ecbb5765e32c53aaf0d383cb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from ._operations import DatasetsOperations as DatasetsOperationsGenerated
from ...models._models import (
DatasetVersion,
FileDatasetVersion,
FolderDatasetVersion,
PendingUploadRequest,
PendingUploadType,
PendingUploadResponse,
Expand Down Expand Up @@ -143,11 +145,11 @@ async def upload_file(self, *, name: str, version: str, file: str, **kwargs: Any
dataset_version = await self.create_or_update(
name=name,
version=output_version,
body=DatasetVersion(
body=FileDatasetVersion(
# See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#azure-storage-blob-blobclient-url
# Per above doc the ".url" contains SAS token... should this be stripped away?
dataset_uri=blob_client.url, # "<account>.blob.windows.core.net/<container>/<file_name>"
type=DatasetType.URI_FILE,
open_ai_purpose="what-should-this-be", # TODO: What is the purpose of this field?
),
)

Expand Down Expand Up @@ -206,11 +208,10 @@ async def upload_folder(self, *, name: str, version: str, folder: str, **kwargs:
dataset_version = await self.create_or_update(
name=name,
version=output_version,
body=DatasetVersion(
body=FolderDatasetVersion(
# See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#azure-storage-blob-blobclient-url
# Per above doc the ".url" contains SAS token... should this be stripped away?
dataset_uri=container_client.url, # "<account>.blob.windows.core.net/<container> ?"
type=DatasetType.URI_FOLDER,
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
import logging
from typing import Optional, AsyncIterable, TYPE_CHECKING
from typing import Optional, AsyncIterable, TYPE_CHECKING, Any
from urllib.parse import urlparse
from azure.core.exceptions import ResourceNotFoundError
from azure.core.tracing.decorator_async import distributed_trace_async
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def build_connections_get_with_credentials_request( # pylint: disable=name-too-
accept = _headers.pop("Accept", "application/json")

# Construct URL
_url = "/connections/{name}/withCredentials"
_url = "/connections/{name}/getconnectionwithcredentials"
path_format_arguments = {
"name": _SERIALIZER.url("name", name, "str"),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from ._operations import DatasetsOperations as DatasetsOperationsGenerated
from ..models._models import (
DatasetVersion,
FileDatasetVersion,
FolderDatasetVersion,
PendingUploadRequest,
PendingUploadType,
PendingUploadResponse,
Expand Down Expand Up @@ -142,11 +144,11 @@ def upload_file(self, *, name: str, version: str, file: str, **kwargs: Any) -> D
dataset_version = self.create_or_update(
name=name,
version=output_version,
body=DatasetVersion(
body=FileDatasetVersion(
# See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#azure-storage-blob-blobclient-url
# Per above doc the ".url" contains SAS token... should this be stripped away?
dataset_uri=blob_client.url, # "<account>.blob.windows.core.net/<container>/<file_name>"
type=DatasetType.URI_FILE,
open_ai_purpose="what-should-this-be", # TODO: What should this be?
),
)

Expand Down Expand Up @@ -204,11 +206,10 @@ def upload_folder(self, *, name: str, version: str, folder: str, **kwargs: Any)
dataset_version = self.create_or_update(
name=name,
version=output_version,
body=DatasetVersion(
body=FolderDatasetVersion(
# See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#azure-storage-blob-blobclient-url
# Per above doc the ".url" contains SAS token... should this be stripped away?
dataset_uri=container_client.url, # "<account>.blob.windows.core.net/<container> ?"
type=DatasetType.URI_FOLDER,
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
import logging
from typing import Optional, Iterable, TYPE_CHECKING
from typing import Optional, Iterable, TYPE_CHECKING, Any
from urllib.parse import urlparse
from azure.core.exceptions import ResourceNotFoundError
from azure.core.tracing.decorator import distributed_trace
Expand All @@ -29,8 +29,8 @@ class InferenceOperations:
**DO NOT** instantiate this class directly.

Instead, you should access the following operations through
def __init__(self, outer_instance: "AIProjectClient") -> None:
self._outer_instance = outer_instance
:class:`~azure.ai.projects.AIProjectClient`'s
:attr:`inference` attribute.
"""

def __init__(self, outer_instance: "azure.ai.projects.AIProjectClient") -> None: # type: ignore[name-defined]
Expand Down
1 change: 1 addition & 0 deletions sdk/ai/azure-ai-projects/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"GENAI",
"UPIA",
"ansii",
"getconnectionwithcredentials",
],
"ignorePaths": [
]
Expand Down
Loading