authzed-py icon indicating copy to clipboard operation
authzed-py copied to clipboard

Unable to use the attributes from the gRPC Response

Open abhaybhargav opened this issue 1 year ago • 3 comments

Hi there, I am trying to use this with the spicedb serverless product.

I am able to create policies, etc. but when I try to run a CheckPermissionsRequest (which I know works), it doesnt allow me to access the permissionship attribute, as indicated in your examples. What am I possibly doing wrong?

resp = client.CheckPermission(
    CheckPermissionRequest(
        resource=company_ref,
        permission="administrator",
        subject=blah,
    ),
)

print(resp.permissionship)

abhaybhargav avatar Jan 27 '24 10:01 abhaybhargav

Hitting the same issue:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[36], line 1
----> 1 resp.permissionship

AttributeError: 'UnaryUnaryCall' object has no attribute 'permissionship'

jtfidje avatar Feb 29 '24 12:02 jtfidje

@abhaybhargav do any of those examples help? What version of the SDK are you using? Python version? https://github.com/authzed/authzed-py/blob/98e992171089c3b65e2c708a215947ac111c4562/tests/v1_test.py#L58-L102

vroldanbet avatar Feb 29 '24 12:02 vroldanbet

I've done some digging and it appears that the issue may be related to the grpcio version. After checking out the poetry.lock file from the repository and reinstalling the dependencies, several packages were downgraded, including grpcio from 1.62.0 to 1.59.0.

Here is a list of downgrades that occurred:

  • Downgrading pyasn1 (0.5.1 -> 0.5.0)
  • Downgrading cachetools (5.3.3 -> 5.3.1)
  • Downgrading certifi (2024.2.2 -> 2023.7.22)
  • Downgrading charset-normalizer (3.3.2 -> 3.3.0)
  • Downgrading idna (3.6 -> 3.4)
  • Downgrading urllib3 (2.2.1 -> 2.0.7)
  • Downgrading appier (1.32.0 -> 1.31.4)
  • Downgrading google-auth (2.28.1 -> 2.23.3)
  • Downgrading googleapis-common-protos (1.62.0 -> 1.61.0)
  • Downgrading google-api-core (2.17.1 -> 2.15.0)
  • Downgrading grpcio (1.62.0 -> 1.59.0)

This may just be a coincidence. I'll try to create an environment where I can consistently reproduce the error and post here afterwards.

jtfidje avatar Feb 29 '24 13:02 jtfidje

Given that there hasn't been any chatter on this, I'm going to assume the issue isn't present anymore and close the issue. Please let me know if you're still seeing this and we can reopen and debug.

tstirrat15 avatar Sep 19 '24 17:09 tstirrat15