You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Backward compatible type subscriptions/unions (#48)
* fix: Backward compatible type subscriptions/unions
Previously, the codebase specified support for Python>=3.8, when it used
`|` type union syntax (introduced in 3.10), and subscriptable built-in
types (introduced in 3.9).
This change uses earlier syntax in order to allow 3.8 interpreters to
handle type specific code.
Signed-off-by: Sam Lock <sam@swlock.co.uk>
raiseTypeError("timeout_secs must be a number type")
@@ -98,7 +98,7 @@ def __init__(
98
98
ifrequest_retries<2:
99
99
request_retries=0
100
100
101
-
method_config: dict[str, Any] = {}
101
+
method_config: Dict[str, Any] = {}
102
102
103
103
ifmethods:
104
104
method_config["name"] =methods
@@ -155,7 +155,7 @@ class AsyncCerbosClient(AsyncClientBase):
155
155
timeout_secs (float): Optional request timeout in seconds (no timeout by default)
156
156
request_retries (int): Optional maximum number of retries, including the original attempt. Anything below 2 will be treated as 0 (disabled)
157
157
wait_for_ready (bool): Boolean specifying whether RPCs should wait until the connection is ready. Defaults to False
158
-
channel_options (dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
158
+
channel_options (Dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
159
159
160
160
Example:
161
161
with AsyncCerbosClient("localhost:3593") as cerbos:
@@ -417,7 +420,7 @@ class AsyncCerbosAdminClient(AsyncClientBase):
417
420
timeout_secs (float): Optional request timeout in seconds (no timeout by default)
418
421
request_retries (int): Optional maximum number of retries, including the original attempt. Anything below 2 will be treated as 0 (disabled)
419
422
wait_for_ready (bool): Boolean specifying whether RPCs should wait until the connection is ready. Defaults to False
420
-
channel_options (dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
423
+
channel_options (Dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
421
424
422
425
Example:
423
426
with AsyncCerbosAdminClient("localhost:3593", admin_credentials=AdminCredentials("admin", "some_password")) as cerbos:
@@ -435,12 +438,12 @@ class AsyncCerbosAdminClient(AsyncClientBase):
raiseTypeError("timeout_secs must be a number type")
@@ -98,7 +98,7 @@ def __init__(
98
98
ifrequest_retries<2:
99
99
request_retries=0
100
100
101
-
method_config: dict[str, Any] = {}
101
+
method_config: Dict[str, Any] = {}
102
102
103
103
ifmethods:
104
104
method_config["name"] =methods
@@ -155,7 +155,7 @@ class CerbosClient(SyncClientBase):
155
155
timeout_secs (float): Optional request timeout in seconds (no timeout by default)
156
156
request_retries (int): Optional maximum number of retries, including the original attempt. Anything below 2 will be treated as 0 (disabled)
157
157
wait_for_ready (bool): Boolean specifying whether RPCs should wait until the connection is ready. Defaults to False
158
-
channel_options (dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
158
+
channel_options (Dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
159
159
160
160
Example:
161
161
with AsyncCerbosClient("localhost:3593") as cerbos:
@@ -417,7 +420,7 @@ class CerbosAdminClient(SyncClientBase):
417
420
timeout_secs (float): Optional request timeout in seconds (no timeout by default)
418
421
request_retries (int): Optional maximum number of retries, including the original attempt. Anything below 2 will be treated as 0 (disabled)
419
422
wait_for_ready (bool): Boolean specifying whether RPCs should wait until the connection is ready. Defaults to False
420
-
channel_options (dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
423
+
channel_options (Dict[str, Any]): Optional gRPC channel options to pass on channel creation. The values need to match the expected types: https://github.com/grpc/grpc/blob/7536d8a849c0096e4c968e7730306872bb5ec674/include/grpc/impl/grpc_types.h
421
424
422
425
Example:
423
426
with AsyncCerbosAdminClient("localhost:3593", admin_credentials=AdminCredentials("admin", "some_password")) as cerbos:
@@ -435,12 +438,12 @@ class CerbosAdminClient(SyncClientBase):
0 commit comments