onebusaway 1.12.0__py3-none-any.whl → 1.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1071,7 +1071,14 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1071
1071
  ) -> ResponseT:
1072
1072
  origin = get_origin(cast_to) or cast_to
1073
1073
 
1074
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074
+ if (
1075
+ inspect.isclass(origin)
1076
+ and issubclass(origin, BaseAPIResponse)
1077
+ # we only want to actually return the custom BaseAPIResponse class if we're
1078
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1079
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081
+ ):
1075
1082
  if not issubclass(origin, APIResponse):
1076
1083
  raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
1077
1084
 
@@ -1574,7 +1581,14 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1574
1581
  ) -> ResponseT:
1575
1582
  origin = get_origin(cast_to) or cast_to
1576
1583
 
1577
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584
+ if (
1585
+ inspect.isclass(origin)
1586
+ and issubclass(origin, BaseAPIResponse)
1587
+ # we only want to actually return the custom BaseAPIResponse class if we're
1588
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
1589
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591
+ ):
1578
1592
  if not issubclass(origin, AsyncAPIResponse):
1579
1593
  raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
1580
1594
 
onebusaway/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "onebusaway"
4
- __version__ = "1.12.0" # x-release-please-version
4
+ __version__ = "1.12.1" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: onebusaway
3
- Version: 1.12.0
3
+ Version: 1.12.1
4
4
  Summary: The official Python library for the onebusaway-sdk API
5
5
  Project-URL: Homepage, https://github.com/OneBusAway/python-sdk
6
6
  Project-URL: Repository, https://github.com/OneBusAway/python-sdk
@@ -1,5 +1,5 @@
1
1
  onebusaway/__init__.py,sha256=ku3rAJ6hbPMCdJIRExmanIm3dbFgnYN0uQsNyd7IIsU,2623
2
- onebusaway/_base_client.py,sha256=BVomSkBBLXZt7eH4cRBbdcoSjazRKjH0cb084HmZsY0,65096
2
+ onebusaway/_base_client.py,sha256=r8AanDIn8oBTvs_PTcDdcrNq5YGVAn6y_hnZUJ4Y6QM,65888
3
3
  onebusaway/_client.py,sha256=dGw5u-pBQRdxZLFdYVOATktwqgNSIWv3y2PyH_ziaKU,37100
4
4
  onebusaway/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  onebusaway/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
@@ -11,7 +11,7 @@ onebusaway/_resource.py,sha256=t-CkWpnm2UyE1uiv87GODlyRcQ_8h5eXmSVoE-1u35w,1142
11
11
  onebusaway/_response.py,sha256=x_FC3ZoD8JnfQRtZibna0wxoBtNzKcVictes8B7N6NQ,28848
12
12
  onebusaway/_streaming.py,sha256=PC8tKxRCeoJn8xKBBxXTlppGSI4TOMYVNfxrabFkRfc,10128
13
13
  onebusaway/_types.py,sha256=OUYNO_zPft2ZRZXakg0aIsBjCoAJLRet90u8LO8WBB4,6201
14
- onebusaway/_version.py,sha256=qxwnkIHurYExJoF8zLGYA8wNze3t5VJ0ub9LSqLpHoQ,163
14
+ onebusaway/_version.py,sha256=yv8Bemchd8506KyJnzvt7rX3_3lmK8mW76cxj5mSINc,163
15
15
  onebusaway/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  onebusaway/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  onebusaway/_utils/_logs.py,sha256=tVIAhl7_vbQL4nJ8QdLAHJ0YzQYbW2gTATmjneY_JxI,790
@@ -104,7 +104,7 @@ onebusaway/types/vehicles_for_agency_list_response.py,sha256=IUX2zHummRU2ChQsGYt
104
104
  onebusaway/types/shared/__init__.py,sha256=ui9M5r_ahasuyksUJVAHHYtdXvg3L_uxVgJY6LMdiPY,201
105
105
  onebusaway/types/shared/references.py,sha256=By29adWfDkZwH6_80NFuvP5NPKOcz9JUqUzaq-iAjQw,7317
106
106
  onebusaway/types/shared/response_wrapper.py,sha256=0i161M7PC8iPq2RzNt8DxZFlvSvdgD9xBcs0ugER0rY,331
107
- onebusaway-1.12.0.dist-info/METADATA,sha256=fcfi0Y93I2xB8iXPKCZt3RqyljGjyDnbkkY8SYJfBh4,12727
108
- onebusaway-1.12.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
109
- onebusaway-1.12.0.dist-info/licenses/LICENSE,sha256=czZkEz_7Kzvn7AGsFsY_RUYL132SXtB5Mcrjoq29Vfo,11344
110
- onebusaway-1.12.0.dist-info/RECORD,,
107
+ onebusaway-1.12.1.dist-info/METADATA,sha256=qq_KYX2bxFAymeWQZ-JhQv8C0gl1sljwQ0lUzbZ03rk,12727
108
+ onebusaway-1.12.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
109
+ onebusaway-1.12.1.dist-info/licenses/LICENSE,sha256=czZkEz_7Kzvn7AGsFsY_RUYL132SXtB5Mcrjoq29Vfo,11344
110
+ onebusaway-1.12.1.dist-info/RECORD,,