Skip to content
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

Update testing #13821

Merged
merged 12 commits into from
Sep 23, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_table_access_policy(
**kwargs)
except HttpResponseError as error:
_process_table_error(error)
return {s.id: s.access_policy or AccessPolicy() for s in identifiers} # pylint: disable=E1125
return {s.id: s.access_policy or AccessPolicy(start=None, expiry=None, permission=None) for s in identifiers}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference here? Is this because some of these parameters are required in the constructor?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to recall that setting these values to None might actually change the structure of the request body....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes these are required parameters. There are actually two different AccessPolicy classes right now, one in the generated code and another here. The latter inherits from the generated code and all arguments are defaulted to None.


@distributed_trace
def set_table_access_policy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
self,
account_url, # type: str
table_name, # type: str
credential, # type : Optional[Any]=None
credential=None, # type : Optional[Any]=None
**kwargs # type: Any
):
# type: (...) -> None
Expand Down Expand Up @@ -163,7 +163,7 @@ async def get_table_access_policy(
**kwargs)
except HttpResponseError as error:
_process_table_error(error)
return {s.id: s.access_policy or AccessPolicy() for s in identifiers}
return {s.id: s.access_policy or AccessPolicy(start=None, expiry=None, permission=None) for s in identifiers}

@distributed_trace_async
async def set_table_access_policy(
Expand Down
Loading