Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fall back to wire type for unknown or unsupported encode
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg1MzAwNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.0.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg1ODA3NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.0.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg1MzAwNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.0.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg1ODA3NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.0.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestDuration(DurationClientTestBase):
def test_duration_constant(self, duration_endpoint):
client = self.create_client(endpoint=duration_endpoint)
response = client.duration_constant(
body={"input": "1 day, 0:00:00"},
body={"input": "str"},
)

# please add some check logic here by yourself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestDurationAsync(DurationClientTestBaseAsync):
async def test_duration_constant(self, duration_endpoint):
client = self.create_async_client(endpoint=duration_endpoint)
response = await client.duration_constant(
body={"input": "1 day, 0:00:00"},
body={"input": "str"},
)

# please add some check logic here by yourself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

import datetime
from typing import Any, Mapping, overload

from .._utils.model_base import Model as _Model, rest_field
Expand All @@ -17,17 +16,17 @@ class DurationModel(_Model):
"""DurationModel.

:ivar input: Required.
:vartype input: ~datetime.timedelta
:vartype input: str
"""

input: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
input: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
input: datetime.timedelta,
input: str,
) -> None: ...

@overload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ async def float64_seconds(self, *, input: float, **kwargs: Any) -> None:
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds(self, *, input: datetime.timedelta, **kwargs: Any) -> None:
async def int32_milliseconds(self, *, input: int, **kwargs: Any) -> None:
"""int32_milliseconds.

:keyword input: Required.
:paramtype input: ~datetime.timedelta
:paramtype input: int
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -476,11 +476,11 @@ async def int32_milliseconds(self, *, input: datetime.timedelta, **kwargs: Any)
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds_larger_unit(self, *, input: datetime.timedelta, **kwargs: Any) -> None:
async def int32_milliseconds_larger_unit(self, *, input: int, **kwargs: Any) -> None:
"""int32_milliseconds_larger_unit.

:keyword input: Required.
:paramtype input: ~datetime.timedelta
:paramtype input: int
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -523,11 +523,11 @@ async def int32_milliseconds_larger_unit(self, *, input: datetime.timedelta, **k
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float_milliseconds(self, *, input: datetime.timedelta, **kwargs: Any) -> None:
async def float_milliseconds(self, *, input: float, **kwargs: Any) -> None:
"""float_milliseconds.

:keyword input: Required.
:paramtype input: ~datetime.timedelta
:paramtype input: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -570,11 +570,11 @@ async def float_milliseconds(self, *, input: datetime.timedelta, **kwargs: Any)
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float_milliseconds_larger_unit(self, *, input: datetime.timedelta, **kwargs: Any) -> None:
async def float_milliseconds_larger_unit(self, *, input: float, **kwargs: Any) -> None:
"""float_milliseconds_larger_unit.

:keyword input: Required.
:paramtype input: ~datetime.timedelta
:paramtype input: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -617,11 +617,11 @@ async def float_milliseconds_larger_unit(self, *, input: datetime.timedelta, **k
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float64_milliseconds(self, *, input: datetime.timedelta, **kwargs: Any) -> None:
async def float64_milliseconds(self, *, input: float, **kwargs: Any) -> None:
"""float64_milliseconds.

:keyword input: Required.
:paramtype input: ~datetime.timedelta
:paramtype input: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -711,11 +711,11 @@ async def int32_seconds_array(self, *, input: list[int], **kwargs: Any) -> None:
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds_array(self, *, input: list[datetime.timedelta], **kwargs: Any) -> None:
async def int32_milliseconds_array(self, *, input: list[int], **kwargs: Any) -> None:
"""int32_milliseconds_array.

:keyword input: Required.
:paramtype input: list[~datetime.timedelta]
:paramtype input: list[int]
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -2908,11 +2908,11 @@ async def float64_seconds(self, *, duration: float, **kwargs: Any) -> None:
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds(self, *, duration: datetime.timedelta, **kwargs: Any) -> None:
async def int32_milliseconds(self, *, duration: int, **kwargs: Any) -> None:
"""int32_milliseconds.

:keyword duration: Required.
:paramtype duration: ~datetime.timedelta
:paramtype duration: int
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -2955,11 +2955,11 @@ async def int32_milliseconds(self, *, duration: datetime.timedelta, **kwargs: An
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds_larger_unit(self, *, duration: datetime.timedelta, **kwargs: Any) -> None:
async def int32_milliseconds_larger_unit(self, *, duration: int, **kwargs: Any) -> None:
"""int32_milliseconds_larger_unit.

:keyword duration: Required.
:paramtype duration: ~datetime.timedelta
:paramtype duration: int
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -3002,11 +3002,11 @@ async def int32_milliseconds_larger_unit(self, *, duration: datetime.timedelta,
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float_milliseconds(self, *, duration: datetime.timedelta, **kwargs: Any) -> None:
async def float_milliseconds(self, *, duration: float, **kwargs: Any) -> None:
"""float_milliseconds.

:keyword duration: Required.
:paramtype duration: ~datetime.timedelta
:paramtype duration: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -3049,11 +3049,11 @@ async def float_milliseconds(self, *, duration: datetime.timedelta, **kwargs: An
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float_milliseconds_larger_unit(self, *, duration: datetime.timedelta, **kwargs: Any) -> None:
async def float_milliseconds_larger_unit(self, *, duration: float, **kwargs: Any) -> None:
"""float_milliseconds_larger_unit.

:keyword duration: Required.
:paramtype duration: ~datetime.timedelta
:paramtype duration: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -3096,11 +3096,11 @@ async def float_milliseconds_larger_unit(self, *, duration: datetime.timedelta,
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def float64_milliseconds(self, *, duration: datetime.timedelta, **kwargs: Any) -> None:
async def float64_milliseconds(self, *, duration: float, **kwargs: Any) -> None:
"""float64_milliseconds.

:keyword duration: Required.
:paramtype duration: ~datetime.timedelta
:paramtype duration: float
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down Expand Up @@ -3143,11 +3143,11 @@ async def float64_milliseconds(self, *, duration: datetime.timedelta, **kwargs:
return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def int32_milliseconds_array(self, *, duration: list[datetime.timedelta], **kwargs: Any) -> None:
async def int32_milliseconds_array(self, *, duration: list[int], **kwargs: Any) -> None:
"""int32_milliseconds_array.

:keyword duration: Required.
:paramtype duration: list[~datetime.timedelta]
:paramtype duration: list[int]
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ class Float64MillisecondsDurationProperty(_Model):
"""Float64MillisecondsDurationProperty.

:ivar value: Required.
:vartype value: ~datetime.timedelta
:vartype value: float
"""

value: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: datetime.timedelta,
value: float,
) -> None: ...

@overload
Expand Down Expand Up @@ -101,17 +101,17 @@ class FloatMillisecondsDurationArrayProperty(_Model):
"""FloatMillisecondsDurationArrayProperty.

:ivar value: Required.
:vartype value: list[~datetime.timedelta]
:vartype value: list[float]
"""

value: list[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: list[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: list[datetime.timedelta],
value: list[float],
) -> None: ...

@overload
Expand All @@ -129,17 +129,17 @@ class FloatMillisecondsDurationProperty(_Model):
"""FloatMillisecondsDurationProperty.

:ivar value: Required.
:vartype value: ~datetime.timedelta
:vartype value: float
"""

value: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: datetime.timedelta,
value: float,
) -> None: ...

@overload
Expand All @@ -157,17 +157,17 @@ class FloatMillisecondsLargerUnitDurationProperty(_Model): # pylint: disable=na
"""FloatMillisecondsLargerUnitDurationProperty.

:ivar value: Required.
:vartype value: ~datetime.timedelta
:vartype value: float
"""

value: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: datetime.timedelta,
value: float,
) -> None: ...

@overload
Expand Down Expand Up @@ -269,17 +269,17 @@ class Int32MillisecondsDurationProperty(_Model):
"""Int32MillisecondsDurationProperty.

:ivar value: Required.
:vartype value: ~datetime.timedelta
:vartype value: int
"""

value: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: datetime.timedelta,
value: int,
) -> None: ...

@overload
Expand All @@ -297,17 +297,17 @@ class Int32MillisecondsLargerUnitDurationProperty(_Model): # pylint: disable=na
"""Int32MillisecondsLargerUnitDurationProperty.

:ivar value: Required.
:vartype value: ~datetime.timedelta
:vartype value: int
"""

value: datetime.timedelta = rest_field(visibility=["read", "create", "update", "delete", "query"])
value: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
value: datetime.timedelta,
value: int,
) -> None: ...

@overload
Expand Down
Loading
Loading